{
  "meta": {
    "repo": "astral-sh/ruff",
    "owner": "tamird",
    "updatedAt": "2026-11-28T10:16:45+00:00",
    "repositories": {
      "astral-sh/ruff": "none",
      "tamird/ruff": "none",
      "bazelbuild/bazel": "none",
      "bazelbuild/bazel-skylib": "none",
      "bazelbuild/rules_cc": "none",
      "hermeticbuild/hermetic-llvm": "none",
      "bazelbuild/apple_support": "none",
      "fmeum/with_cfg.bzl": "none",
      "bazel-contrib/rules_runfiles_group": "none",
      "hermeticbuild/rules_rs": "none",
      "bazel-contrib/bazel_features": "none",
      "bazelbuild/rules_java": "none",
      "bazelbuild/starlark": "none"
    },
    "inventory": {
      "pinnedFork": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
      "forkBase": "75fabee2e0a069b6bf5a1af4226025afa0324fa5",
      "upstreamAudited": "75fabee2e0a069b6bf5a1af4226025afa0324fa5",
      "divergentCommits": 55,
      "userAuthoredCommits": 55,
      "upstreamAuthoredPicks": 0,
      "status": "Qualified Sty 14d05b98 pins Ruff 07a4f30c on official 75fabee2. Native targets, optimized Linux and all 148 unchanged corpus cases pass. All 20 community checks execute with unchanged outcomes: 11 strict zero-error passes, six advisory completions and three known failures. All eight qualified workflow refreshes are published; GitHub CI and reviews are tracked separately from completed RBE qualification.",
      "reviewedCandidate": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
      "reviewedBase": "6b5b5eca948c05261a3909e78133884cd9e61c9e",
      "sourceReviewComplete": false,
      "sourceReview": {
        "candidate": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
        "base": "6b5b5eca948c05261a3909e78133884cd9e61c9e",
        "changedPaths": 231,
        "runtimePathsWithSourceRecords": 142,
        "solverHunksAttributed": 939,
        "solverReviewUnits": 169,
        "forwardCandidate": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
        "forwardBase": "75fabee2e0a069b6bf5a1af4226025afa0324fa5",
        "url": "https://tamird.github.io/sty/ruff-source-audit.json",
        "qualified": false,
        "forwardNetPaths": 316,
        "forwardRustSourcePaths": 155,
        "forwardAttributedRustPaths": 59,
        "forwardHunks": 455,
        "forwardProducerFamilies": 20
      },
      "scope": "All 17 user-authored Bazel typing issues have dated GitHub receipts. Ruff's frozen source audit and forward reconciliation enumerate surviving mechanisms; reduced upstream reproductions, runtime qualification and remaining overlap review are incomplete. Historical commit counts and source review units are not pending PR counts.",
      "qualification": "Every new upstream proposal needs a current-upstream reproduction, focused negative/positive cases, relevant full qualification and Tamir approval. Existing merged templates, in-review PRs, host extension design and remaining Python fixes are distinct.",
      "historicalGitInventory": {
        "pinnedFork": "352ce32f76a8416551cb72d66dfa4f6d75a7c7e9",
        "forkBase": "d63450150b",
        "upstreamAudited": "aa46aae607",
        "divergentCommits": 495,
        "userAuthoredCommits": 483,
        "upstreamAuthoredPicks": 12
      },
      "publishedRuffCheckpoint": {
        "revision": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
        "sourceRevision": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
        "url": "https://github.com/tamird/ruff/commit/07a4f30c36d8f27455d2785f9abef566e0bf3641",
        "selectedTestsURL": "https://app.buildbuddy.io/invocation/43ad4d02-b014-4606-b1e5-35fdc81f700a",
        "testScope": "Core 101, semantic 904 (35 ignored), IDE 1979, canonical hooks, formatting and strict Clippy pass. Full default Markdown executes 538 fixtures: 507 pass and the same 31 fail, with full failure bodies unchanged after proven line shifts. The inventory action is excluded from this aggregate; network-backed cases remain separate. The compatible-context optimization retains per-expression validation and has separate official cost evidence.",
        "fullMarkdownQualified": false,
        "styIntegrationQualified": true,
        "markdownResults": {
          "revision": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
          "fixtures": 538,
          "passed": 507,
          "failed": 31,
          "compiledHarnesses": 1,
          "url": "https://app.buildbuddy.io/invocation/43ad4d02-b014-4606-b1e5-35fdc81f700a",
          "historical": false,
          "runtimeParent": "940e9c43b2fff543b344863986159b3fda11ae46",
          "identicalFullFailureBodies": 31,
          "improvedFailureBodies": 0,
          "newFailedFiles": 0,
          "resolvedFailedFiles": 0,
          "inventoryActionExcludedFromAggregate": true
        },
        "previousMarkdownResults": {
          "revision": "940e9c43b2fff543b344863986159b3fda11ae46",
          "fixtures": 538,
          "passed": 507,
          "failed": 31,
          "inventoryPassed": true,
          "compiledHarnesses": 1,
          "actionsCompleted": 539,
          "url": "https://app.buildbuddy.io/invocation/91010805-fa38-4499-b97c-137628a5ee57",
          "historical": true,
          "runtimeParent": "5cdb4547e2e2ba2b059abc56ddc245c20675ee4b",
          "identicalFullFailureBodies": 31,
          "improvedFailureBodies": 0,
          "newFailedFiles": 0,
          "resolvedFailedFiles": 0
        }
      },
      "currentSty": {
        "revision": "14d05b98238e2c0bf7773c81bbeb209861a7145b",
        "url": "https://github.com/tamird/sty/commit/14d05b98238e2c0bf7773c81bbeb209861a7145b",
        "ruffRevision": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
        "testScope": "All eight native targets, formatting and the optimized Linux executable pass on RBE with frozen locks. All 148 real corpus cases pass with zero fixture changes and exact source-plan/artifact guards.",
        "testsURL": "https://app.buildbuddy.io/invocation/1aa1749b-e3e7-4d35-9fbc-669a2207b7c1",
        "frozenBuildURL": "https://app.buildbuddy.io/invocation/8a801ba7-161c-4566-834b-7d91c8146965",
        "communityWorkflowExecutionsPlanned": 20,
        "communityRefreshPublished": true,
        "runtimeCorpusQualified": true,
        "fullRuffMarkdownQualified": false,
        "communityQualification": {
          "revision": "14d05b98238e2c0bf7773c81bbeb209861a7145b",
          "planned": 20,
          "executed": 20,
          "strictZeroErrorPasses": 11,
          "advisoryCompletions": 6,
          "failures": 3,
          "requiredSkipped": 0,
          "published": true,
          "scope": "All 20 checks execute with complete coverage and exact source snapshots, identical in outcome, coverage and inputs to 43d26607. Apple retains two toolchain-field errors; LLVM retains 31 released-example and 26 proposed-types errors. RBE native tests pass. rules_rs has zero formatting differences and 148 inherited formatter warnings (exit 1). All eight qualified workflow refreshes are published; current GitHub CI and review status is recorded separately.",
          "assembledFromLatestProjectRuns": true,
          "publishedProjects": [
            "bazel-skylib",
            "bazel_features",
            "rules_runfiles_group",
            "rules_cc",
            "rules_rs",
            "with_cfg.bzl",
            "apple_support",
            "hermetic-llvm"
          ],
          "remainingProjects": 0,
          "historicalForCurrentSty": false,
          "currentRevisionPending": false,
          "readyProjects": [
            "bazel-skylib",
            "bazel_features",
            "rules_runfiles_group",
            "rules_cc",
            "rules_rs",
            "with_cfg.bzl"
          ],
          "repairProjects": 2,
          "publicationBlocker": null
        },
        "defaultCorpusManifestCurrent": true,
        "corpusQualification": {
          "revision": "14d05b98238e2c0bf7773c81bbeb209861a7145b",
          "passed": 148,
          "failed": 0,
          "manifestPublished": true,
          "inputsPublished": true,
          "fixtureChanges": 0,
          "scope": "All 148 actual cases pass on Sty 14d05b98 with zero fixture changes. All eight artifact hashes and exact source plans are verified; the existing published corpus manifest and source commits are unchanged.",
          "projects": [
            {
              "project": "bazel_features",
              "sourceCommit": "657a891ce2224a999dcc766c4acaa0ed328c9dcc",
              "casesPassed": 3,
              "url": "https://app.buildbuddy.io/invocation/01cb2b3f-1ded-4f99-a55e-2fcc1a34169f",
              "artifactSHA256": "913af95905d131c265196c8e40ff716a976db7ff0be04f87c267f3577c60e321"
            },
            {
              "project": "rules_cc",
              "sourceCommit": "a8ab72427b395721342468c8d64ab14e44482983",
              "casesPassed": 7,
              "url": "https://app.buildbuddy.io/invocation/b5565378-45f7-4754-93e6-59565255ace2",
              "artifactSHA256": "6689476894d5f68a9c438968271ab714330623ec34d92486e4fb74b2efe0a08b"
            },
            {
              "project": "bazel-skylib",
              "sourceCommit": "903bcc4b5175b7dff751c4ed8f4fecce84634fe4",
              "casesPassed": 8,
              "url": "https://app.buildbuddy.io/invocation/a0b59233-7311-4d33-a681-aec6a4ce224a",
              "artifactSHA256": "13ce054ad2014ba7efbb4019832cd6932812fb1ccedbf7713ab37c6b42abc78f"
            },
            {
              "project": "rules_rs",
              "sourceCommit": "fa5b73e2ac1c77470c52e2776034a314803a8029",
              "casesPassed": 6,
              "url": "https://app.buildbuddy.io/invocation/c78be14d-ea22-41f6-b91a-6edd652ab041",
              "artifactSHA256": "9692d49894bd171c6a18a222729b65c4813870efbb1a8544d8e3fb8f99d442c2"
            },
            {
              "project": "rules_runfiles_group",
              "sourceCommit": "0501509db0839f5dff9f743d6fc4f45c9c2656ea",
              "casesPassed": 14,
              "url": "https://app.buildbuddy.io/invocation/87a5a0d6-b6a3-4a8c-ad18-153f321c70b5",
              "artifactSHA256": "232f9502bfa361222da35b6addca60603d7de06f308fc97365ad7f496fae7854"
            },
            {
              "project": "apple_support",
              "sourceCommit": "ec0fb009f2e2ddd0199365f6600d28c598d386c9",
              "casesPassed": 11,
              "url": "https://app.buildbuddy.io/invocation/ad927792-8987-4859-8bc4-267e58e8b785",
              "artifactSHA256": "b87c3df1b4d5279f33d1ecfef009b8af291e74890ce50133afcce5f39aa1ead4"
            },
            {
              "project": "hermetic-llvm",
              "sourceCommit": "dd08026d84b8fc4756d7d682858826ef27702fff",
              "casesPassed": 18,
              "url": "https://app.buildbuddy.io/invocation/24af6077-99eb-4a70-94b7-092a15867638",
              "artifactSHA256": "8123846ac9c373c8ce4c07400873f3d9735a3a6f971d660080f06edb23b0bffb"
            },
            {
              "project": "with_cfg.bzl",
              "sourceCommit": "cace8639b445a96301d6f010d628fb862504665e",
              "casesPassed": 81,
              "url": "https://app.buildbuddy.io/invocation/acc3376f-a0f7-4900-8207-3a0bf7e7093e",
              "artifactSHA256": "33b45fff3e10f3bafabeaa6bf3e0342ee9d4fd9d141c72106f9ea332f376ee68"
            }
          ]
        }
      },
      "latestUpstream": {
        "revision": "75fabee2e0a069b6bf5a1af4226025afa0324fa5",
        "observedOn": "2026-11-21",
        "rebasePending": false,
        "pendingChanges": [],
        "scope": "The 14 recorded merged upstream changes are inherited by public Ruff 07a4f30c on official 75fabee2. The native and Sty integration gates pass; 31 preexisting Ruff Markdown fixtures remain failures. Source accounting remains separate from runtime qualification.",
        "integratedChanges": [
          {
            "number": 30641,
            "area": "TypedDict literal candidate filtering",
            "url": "https://github.com/astral-sh/ruff/pull/30641"
          },
          {
            "number": 30650,
            "area": "Solver path-cache keys and constraint support",
            "url": "https://github.com/astral-sh/ruff/pull/30650"
          },
          {
            "number": 30646,
            "area": "Legacy namespace source-scan cache",
            "url": "https://github.com/astral-sh/ruff/pull/30646"
          },
          {
            "number": 30658,
            "area": "[ty] Skip impossible coverage checks in constraint diagrams (#30658)",
            "url": "https://github.com/astral-sh/ruff/pull/30658",
            "commit": "f29d832189bb5eeeabb0898c823aa4a7e42e2ba6"
          },
          {
            "number": 30643,
            "area": "[ty] Reuse unchanged specializations during cycle recovery (#30643)",
            "url": "https://github.com/astral-sh/ruff/pull/30643",
            "commit": "31cfa858b944e879929aeb63dcadf95faeffb286"
          },
          {
            "number": 30700,
            "area": "[ty] Skip prefix checks when no outer scope can bind a member (#30700)",
            "url": "https://github.com/astral-sh/ruff/pull/30700",
            "commit": "cb79f61f9f3d1eeb13833d05ad42c602cee123af"
          },
          {
            "number": 30668,
            "area": "[ty] Defer semantic indexing until `__all__` analysis needs an expression type (#30668)",
            "url": "https://github.com/astral-sh/ruff/pull/30668",
            "commit": "1b0606b218e6fbede35d22c8921c6c71f7ebfdac"
          },
          {
            "number": 30684,
            "area": "[ty] Avoid quadratic deduplication when displaying literal unions (#30684)",
            "url": "https://github.com/astral-sh/ruff/pull/30684",
            "commit": "dee3e8cd82a330678da00c023be4a6a71d125a94"
          },
          {
            "number": 30667,
            "area": "[ty] Skip tuple specialization for unrelated nominal targets (#30667)",
            "url": "https://github.com/astral-sh/ruff/pull/30667",
            "commit": "4cdf7cacc3f3dc4413579a718eef755095d801d2"
          },
          {
            "number": 30671,
            "area": "[ty] Avoid rebuilding ordinary function signatures to check for type guards (#30671)",
            "url": "https://github.com/astral-sh/ruff/pull/30671",
            "commit": "bda568d1b665fe1581b38f749debc5ecb25f9643"
          },
          {
            "number": 30674,
            "area": "[ty] Skip unnecessary member lookups for enum values (#30674)",
            "url": "https://github.com/astral-sh/ruff/pull/30674",
            "commit": "68354a7ba38109ca6648209bfcc487991b5f5f70"
          },
          {
            "number": 30645,
            "area": "[ty] Reuse materializations of shared unions (#30645)",
            "url": "https://github.com/astral-sh/ruff/pull/30645",
            "commit": "661a84100c4736f507090dd31143069215a451df"
          },
          {
            "number": 30714,
            "area": "[ty] Filter member completions before looking up documentation (#30714)",
            "url": "https://github.com/astral-sh/ruff/pull/30714",
            "commit": "b2287d635d9be03e9f57452c15cb0a16b4fe3e50"
          },
          {
            "number": 30680,
            "area": "[ty] Defer constructing instance types during generated member lookup (#30680)",
            "url": "https://github.com/astral-sh/ruff/pull/30680",
            "commit": "b7014a05ff6db310ca2b3b24f6d82263067d17a6"
          },
          {
            "number": 30665,
            "area": "[ty] Skip unrelated definitions and imports in semantic token range requests (#30665)",
            "url": "https://github.com/astral-sh/ruff/pull/30665",
            "commit": "dd5afa8e5338a2fb81fa1ce26cde97dc0d03d0e3"
          },
          {
            "number": 30702,
            "area": "[ty] Skip inclusion checks when selecting a program under a source root (#30702)",
            "url": "https://github.com/astral-sh/ruff/pull/30702",
            "commit": "295982d1919680d1c63af946e8f0bac8bae344a2"
          },
          {
            "number": 30698,
            "area": "[ty] Skip impossible subtype checks for strings in class object unions (#30698)",
            "url": "https://github.com/astral-sh/ruff/pull/30698",
            "commit": "75fabee2e0a069b6bf5a1af4226025afa0324fa5"
          }
        ]
      },
      "pathAudit": {
        "scope": "old-fork-path-audit",
        "base": "d63450150ba77e0a542de1ce2194084a8eb88373",
        "fork": "352ce32f76a8416551cb72d66dfa4f6d75a7c7e9",
        "upstream": "aa46aae6072ecf8342fb9bbce2b263a75b0eb11c",
        "paths": 250,
        "classifications": {
          "support-classified": 97,
          "partial": 145,
          "mechanism-compared": 1,
          "exact-file-match": 7
        },
        "currentDeltaAudit": {
          "state": "pending",
          "reason": "This historical 250-path manifest is preserved separately. The frozen 231-path source checkpoint attributes 939 solver hunks to 169 review units; the current ruff-forward-audit.json covers all 314 rebased paths and attributes the 43 changed Rust src paths. Selected native gates and Sty integration pass at d10bc8c7, but full Markdown, community qualification, upstream overlap review and isolated contributions remain incomplete. Source coverage does not establish upstream readiness."
        },
        "url": "https://tamird.github.io/sty/ruff-fork-audit.json"
      },
      "solverAudit": {
        "frozen": {
          "revision": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
          "base": "6b5b5eca948c05261a3909e78133884cd9e61c9e",
          "hunkRevision": "7120f37ed86689328b61ec7a00f2fe8d4d378ccd",
          "indexDigest": "3079cbd8391602919f08654ec210ad9dbad6a6c1eba3e0b4ef6c8ec21a33ac8b",
          "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331",
          "baseUrl": "https://github.com/astral-sh/ruff/commit/6b5b5eca948c05261a3909e78133884cd9e61c9e"
        },
        "coverage": {
          "runtimeOrMixedHunks": 939,
          "reviewedRuntimeOrMixedHunks": 939,
          "reviewUnits": 169,
          "reviewedSourceFiles": 18,
          "sourceHunkAttributionComplete": true,
          "runtimeQualified": false,
          "upstreamReady": false,
          "isPullRequestCount": false,
          "detail": "939 runtime or mixed hunks have source attribution across 169 review units. Regression assertion review is partial; runtime qualification and contribution approval remain open."
        },
        "forward": {
          "upstreamBase": "c8ba04dc06caf4370d494870145c4f92356f1222",
          "revision": "9e0685ba54a37b374b62477ca3f65c821f983a22",
          "qualified": false
        },
        "limits": [
          "Hunk IDs refer to the frozen 7120 review ledger; source anchors are translated to the frozen dfe revision.",
          "Source review covers runtime and mixed solver hunks; complete test and snapshot review remains open.",
          "Upstream #29553 still needs remaining per-type migration and fixture review.",
          "The 44 and 9e forward records identify source ownership and API changes; they do not establish runtime qualification.",
          "Existing tracker parents retain ownership. The eleven task records subdivide reviewed mechanisms without committing to a PR count."
        ]
      },
      "forwardAudit": {
        "base": "75fabee2e0a069b6bf5a1af4226025afa0324fa5",
        "revision": "07a4f30c36d8f27455d2785f9abef566e0bf3641",
        "counts": {
          "netPaths": 316,
          "rustSourcePaths": 155,
          "exactFrozenBlobPairs": 153,
          "exactFrozenRustSourceBlobPairs": 96,
          "changedRustSourcePaths": 59,
          "forwardHunks": 455,
          "forwardProducerFamilies": 20
        },
        "runtimeQualified": false,
        "upstreamReady": false,
        "url": "https://tamird.github.io/sty/ruff-forward-audit.json",
        "limits": [
          "Frozen historical inventories, including the 169-unit/939-hunk solver record, remain unchanged. Exact blob-pair reuse is source evidence, not runtime proof; an absent base file is a stable input, not a nonzero blob match.",
          "These 59 forward Rust paths contain mixed runtime, API, upstream migrations and maintained tests; counts do not establish independent contributions.",
          "Every changed hunk is explicitly reviewed by exact path and whole-hunk SHA. Reuse requires exact whole or body equality, never path/start fallback.",
          "Fresh collection inference reuses prepared argument constraints and at most one completed projection. Scoped constraint order remains part of the cache identity; unsupported pack/legacy calls and incomplete outcomes keep their original handling.",
          "Official proposal ba712 remains unapproved while its architecture and documentation are assessed. Its prior qualification is not submission approval; related #27665 overlap remains explicit.",
          "Sty engine 14d05b98 pins 07a and passes all native/optimized and 148 unchanged corpus cases. All eight qualified community workflow updates are published; GitHub CI and reviews remain separate from completed RBE qualification. No all-fork readiness or upstream submission approval is claimed.",
          "Native 43ad results are recorded from the owner receipt, not performed by this audit. The 31 unchanged failed Markdown fixtures remain failures; external-network cases are not covered.",
          "Frozen 169-unit/939-hunk history and 250-path lineage remain unchanged. Rejected global truthiness guard stripping remains absent."
        ]
      }
    }
  },
  "groups": [
    {
      "id": "community",
      "label": "Community type checking"
    },
    {
      "id": "ty",
      "label": "Upstream ty"
    },
    {
      "id": "bazel",
      "label": "Bazel feedback"
    },
    {
      "id": "language",
      "label": "Starlark specification"
    }
  ],
  "nodes": [
    {
      "id": "pr:bazelbuild/bazel-skylib:641",
      "type": "pr",
      "repo": "bazelbuild/bazel-skylib",
      "number": 641,
      "title": "Bazel Skylib: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/bazelbuild/bazel-skylib/pull/641",
      "head": "0d67032913356f4e43f700a5e04b1efa20af96ae",
      "summary": "Helper, collection, partial, provider and rule contracts.\n\nRecorded checks: RBE 14d05b98: 88 root files and five Gazelle files pass with zero errors (two root warnings).\n\nThe qualified Sty 14d05b98 workflow update is published. GitHub CI and review observations are recorded separately below.",
      "evidence": [
        {
          "label": "Skylib #643",
          "url": "https://github.com/bazelbuild/bazel-skylib/pull/643"
        },
        {
          "label": "Skylib #647",
          "url": "https://github.com/bazelbuild/bazel-skylib/pull/647"
        },
        {
          "label": "Skylib #644",
          "url": "https://github.com/bazelbuild/bazel-skylib/pull/644"
        },
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/8ff7faa8-2b15-4412-88dd-3bcdd71ec282"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/bazel-skylib/commit/0d67032913356f4e43f700a5e04b1efa20af96ae"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "0d67032913356f4e43f700a5e04b1efa20af96ae",
        "nextAction": "Prepare the qualified contribution for maintainer review."
      }
    },
    {
      "id": "pr:bazelbuild/rules_cc:940",
      "type": "pr",
      "repo": "bazelbuild/rules_cc",
      "number": 940,
      "title": "rules_cc: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/bazelbuild/rules_cc/pull/940",
      "head": "370815600228a45d71ee2509222ad24b298a45cb",
      "summary": "C++ toolchain providers, helper constructors and macro contracts.\n\nRecorded checks: RBE 14d05b98: 134 strict files pass. All 286 advisory files complete with 37,502 errors.\n\nThe qualified Sty 14d05b98 workflow update is published. GitHub CI and review observations are recorded separately below.",
      "evidence": [
        {
          "label": "rules_cc #960",
          "url": "https://github.com/bazelbuild/rules_cc/pull/960"
        },
        {
          "label": "rules_cc #967",
          "url": "https://github.com/bazelbuild/rules_cc/pull/967"
        },
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/520974a9-09ce-4123-82a6-2f0fc1666564"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/rules_cc/commit/370815600228a45d71ee2509222ad24b298a45cb"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "370815600228a45d71ee2509222ad24b298a45cb",
        "nextAction": "Reduce the remaining advisory diagnostics."
      }
    },
    {
      "id": "pr:hermeticbuild/hermetic-llvm:835",
      "type": "pr",
      "repo": "hermeticbuild/hermetic-llvm",
      "number": 835,
      "title": "hermetic-llvm: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/hermeticbuild/hermetic-llvm/pull/835",
      "head": "cfe15581d127f92e1bcd5582c6b62497217915cd",
      "summary": "LLVM helper, selector and callback contracts compatible with older Bazel releases.\n\nRecorded checks: RBE 14d05b98: 70 released-root files pass; the rules_cc example retains 31 errors. Proposed-types checking retains 26 errors in 64 root files. Advisory checks, native tests and formatter complete.\n\nThe local rebase preserves the new upstream header-module implementation and the existing type contracts. All five header-module tests pass.",
      "evidence": [
        {
          "label": "Skylib #641",
          "url": "https://github.com/bazelbuild/bazel-skylib/pull/641"
        },
        {
          "label": "rules_cc #940",
          "url": "https://github.com/bazelbuild/rules_cc/pull/940"
        },
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/dd978d27-6ff9-436d-8925-6e9e5afc8737"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/hermetic-llvm/commit/cfe15581d127f92e1bcd5582c6b62497217915cd"
        },
        {
          "label": "Rebased header-module tests",
          "url": "https://app.buildbuddy.io/invocation/562b4a75-882e-4961-938d-d57d92880a76"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "cfe15581d127f92e1bcd5582c6b62497217915cd",
        "nextAction": "Resolve the 31 example and 26 proposed-type errors."
      }
    },
    {
      "id": "pr:bazelbuild/apple_support:668",
      "type": "pr",
      "repo": "bazelbuild/apple_support",
      "number": 668,
      "title": "apple_support: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/bazelbuild/apple_support/pull/668",
      "head": "7173262d16db41fe32577f6add2d1826541e7768",
      "summary": "Xcode, lipo, Apple action, DMG and platform provider contracts.\n\nRecorded checks: RBE 14d05b98: All 46 strict files checked; two lipo toolchain-field errors remain. All 76 advisory files complete with 5,994 errors.\n\nThe qualified Sty 14d05b98 workflow update is published. GitHub CI and review observations are recorded separately below.",
      "evidence": [
        {
          "label": "Skylib #641",
          "url": "https://github.com/bazelbuild/bazel-skylib/pull/641"
        },
        {
          "label": "rules_cc #940",
          "url": "https://github.com/bazelbuild/rules_cc/pull/940"
        },
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/842ad4c8-9294-49cf-af5d-a2f94fc894b1"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/apple_support/commit/7173262d16db41fe32577f6add2d1826541e7768"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "7173262d16db41fe32577f6add2d1826541e7768",
        "nextAction": "Preserve LipoInfo through selected-toolchain lookup so strict checking accepts the lipo action."
      }
    },
    {
      "id": "pr:fmeum/with_cfg.bzl:269",
      "type": "pr",
      "repo": "fmeum/with_cfg.bzl",
      "number": 269,
      "title": "with_cfg.bzl: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/fmeum/with_cfg.bzl/pull/269",
      "head": "7628aba59fc362d69d1106ac13bcadd6f64b9b1e",
      "summary": "Settings, selectors, frontend rules, argument rewriting and provider contracts.\n\nRecorded checks: RBE 14d05b98: 20 root and two example files pass with zero diagnostics. All five native suites pass in fast and optimized configurations.\n\nThe qualified Sty 14d05b98 workflow update is published. GitHub CI and review observations are recorded separately below.",
      "evidence": [
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/e508d5a7-d78e-4f07-9226-106a535011a7"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/with_cfg.bzl/commit/7628aba59fc362d69d1106ac13bcadd6f64b9b1e"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "7628aba59fc362d69d1106ac13bcadd6f64b9b1e",
        "nextAction": "Reduce the remaining advisory diagnostics."
      }
    },
    {
      "id": "pr:bazel-contrib/rules_runfiles_group:23",
      "type": "pr",
      "repo": "bazel-contrib/rules_runfiles_group",
      "number": 23,
      "title": "rules_runfiles_group: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/bazel-contrib/rules_runfiles_group/pull/23",
      "head": "b0f9531391d6683b7a1c0fbc66f16e0b9bfdde88",
      "summary": "Provider fields and generic handle types shared by materialize, transform and merge callbacks.\n\nRecorded checks: RBE 14d05b98: 32 root and 37 example files pass; advisory checks retain 646 and 344 errors.\n\nThe qualified Sty 14d05b98 workflow update is published. GitHub CI and review observations are recorded separately below.",
      "evidence": [
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/3f3eb196-021a-4da7-b375-92bc34aea1da"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/rules_runfiles_group/commit/b0f9531391d6683b7a1c0fbc66f16e0b9bfdde88"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "b0f9531391d6683b7a1c0fbc66f16e0b9bfdde88",
        "nextAction": "Reduce the remaining advisory diagnostics."
      }
    },
    {
      "id": "pr:hermeticbuild/rules_rs:306",
      "type": "pr",
      "repo": "hermeticbuild/rules_rs",
      "number": 306,
      "title": "rules_rs: add type checking",
      "group": "community",
      "status": "draft",
      "url": "https://github.com/hermeticbuild/rules_rs/pull/306",
      "head": "9e40f59c20b79e50f163a465f8da5e7001be8cd6",
      "summary": "Crate selection, generated Cargo workspaces, repository generation and Rust toolchain contracts.\n\nRecorded checks: RBE 14d05b98: 36 root and four fixture files pass; both Cargo tests pass. Formatter exit 1 retains exactly 148 inherited warnings and no formatting differences.\n\nThe qualified Sty 14d05b98 workflow update is published. GitHub CI and review observations are recorded separately below.",
      "evidence": [
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/e50f7cbe-1644-47a6-ab44-9586d1b518c7"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/rules_rs/commit/9e40f59c20b79e50f163a465f8da5e7001be8cd6"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "9e40f59c20b79e50f163a465f8da5e7001be8cd6",
        "nextAction": "Keep inherited formatter debt separate from typing qualification."
      }
    },
    {
      "id": "pr:bazel-contrib/bazel_features:158",
      "type": "pr",
      "repo": "bazel-contrib/bazel_features",
      "number": 158,
      "title": "bazel_features: add type checking",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazel-contrib/bazel_features/pull/158",
      "head": "bd893b715c1f28e9533ad9630d22187adc2d5cd6",
      "summary": "Feature compatibility declarations checked against implementations.\n\nRecorded checks: RBE 14d05b98: Eleven strict files and native tests pass. Advisory root and BCR checks retain 64 and 22 errors.\n\nThe qualified Sty 14d05b98 workflow update is published. Both current GitHub Actions runs report action_required with zero jobs. Verification used an account with read-only access to the base repository; the API gives no exact policy reason.",
      "evidence": [
        {
          "label": "14d05b98 workflow qualification",
          "url": "https://app.buildbuddy.io/invocation/fd8a4ebc-dc39-486a-bd33-a252767c94eb"
        },
        {
          "label": "Published workflow update",
          "url": "https://github.com/tamird/bazel_features/commit/bd893b715c1f28e9533ad9630d22187adc2d5cd6"
        },
        {
          "label": "CI: action_required on published head",
          "url": "https://github.com/bazel-contrib/bazel_features/actions/runs/44955959050"
        },
        {
          "label": "Starlark types: action_required on published head",
          "url": "https://github.com/bazel-contrib/bazel_features/actions/runs/44955959049"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "bd893b715c1f28e9533ad9630d22187adc2d5cd6",
        "nextAction": "Reduce the remaining root and BCR advisory diagnostics."
      }
    },
    {
      "id": "pr:bazelbuild/bazel:32042",
      "type": "pr",
      "repo": "bazelbuild/bazel",
      "number": 32042,
      "title": "Type empty netrc entries and auth patterns",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazelbuild/bazel/pull/32042",
      "head": "0e0a4084463d41831a1b6d77e88b7a39d1272609",
      "summary": "Declare netrc entry/auth-pattern value types at their allocation boundaries.\n\nRecorded checks: The mechanical rebase resolves the generated lockfile conflict. Bazel’s default-lockfile verifier passed remotely, including on master 1b7e3767.\n\nNative annotations would enable the whole-parser checker and encounter the optional-key narrowing gap in #32022. Current type-comment change does not require that bug to land first.",
      "evidence": [
        {
          "label": "Bazel None-narrowing feedback #32022",
          "url": "https://github.com/bazelbuild/bazel/issues/32022"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "0e0a4084463d41831a1b6d77e88b7a39d1272609",
        "nextAction": "Follow CI and maintainer review on the rebased head."
      },
      "settledReviews": [
        {
          "kind": "amendment",
          "status": "settled",
          "head": "0e0a4084463d41831a1b6d77e88b7a39d1272609",
          "baseHead": "0e050975ccf0a0c6964d6f75bc277929553b7888",
          "url": "https://github.com/tamird/bazel/commit/0e0a4084463d41831a1b6d77e88b7a39d1272609",
          "title": "Review regenerated Bazel test lockfile",
          "summary": "The mechanical rebase is published on #32042. The Starlark annotations are unchanged.",
          "body": "Bazel master changed the generated test lockfile. The rebased commit keeps both Starlark annotations and uses the digests emitted by the repository’s lockfile generator. [Remote lockfile verification](https://app.buildbuddy.io/invocation/8aebe42f-eb88-43e6-9eaf-01010c9d5d2f).\n\nCaptured with `git range-diff --no-color --no-dual-color --creation-factor=999 0e050975ccf0a0c6964d6f75bc277929553b7888^! 0e0a4084463d41831a1b6d77e88b7a39d1272609^!`.\n\n```diff\n1:  0e050975 ! 1:  0e0a4084 Type empty netrc entries and auth patterns\n    @@ src/test/tools/bzlmod/MODULE.bazel.lock\n        \"moduleExtensions\": {\n          \"@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions\": {\n            \"general\": {\n    --        \"bzlTransitiveDigest\": \"NQFIdq+YnfvjDoMTtaioZwbozGcB7rrpgG8sO/Zz30k=\",\n    -+        \"bzlTransitiveDigest\": \"CBolO2P5L7Ofqt9FhraKPpbSSChR+gmj6p/YOxjWETw=\",\n    +-        \"bzlTransitiveDigest\": \"6ME6/jGDagS39Ejq+9RGIUiKVWKi5JsB5f/WuN2b4gU=\",\n    ++        \"bzlTransitiveDigest\": \"MBLFxyNs7mQPCLrv7GDEeq9+GpM0cAmKgZS4nZD2/QM=\",\n              \"usagesDigest\": \"ZQiGVXrj8yl+WvAOGWZCipKxak7/2zZWT+1/qI4Ac4U=\",\n              \"recordedInputs\": [\n                \"REPO_MAPPING:rules_kotlin+,bazel_tools bazel_tools\"\n```",
          "outcome": "posted"
        }
      ]
    },
    {
      "id": "pr:bazelbuild/rules_java:388",
      "type": "pr",
      "repo": "bazelbuild/rules_java",
      "number": 388,
      "title": "Construct java_common with explicit fields",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazelbuild/rules_java/pull/388",
      "head": "ddd484a4dc5e46879bca1df691f6648fa274d63d",
      "summary": "Expose unconditional struct fields directly while preserving conditional-field values and evaluation order.\n\nRecorded checks: PR reports a downstream sty check resolves provider key/callable signatures; provider-level current check receipts are not collected here.\n\nsty loses field types across the unannotated java_common factory. This is a support refactor, not a claim that all rules_java sources are type checked.",
      "evidence": [],
      "followup": {
        "owner": "Agent",
        "sourceHead": "ddd484a4dc5e46879bca1df691f6648fa274d63d",
        "nextAction": "Recheck factory inference before retaining the source refactor workaround."
      }
    },
    {
      "repo": "bazelbuild/bazel-skylib",
      "number": 643,
      "title": "Report duplicate Label conditions",
      "head": "c37db57d4f08817c1cabdb8cd8c9fc0a2cdd56d8",
      "state": "open",
      "summary": "Extracted from Skylib #641; runtime duplicate-label diagnostic fix.",
      "parent": [
        "bazelbuild/bazel-skylib",
        641
      ],
      "relation": "includes",
      "id": "pr:bazelbuild/bazel-skylib:643",
      "type": "pr",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazelbuild/bazel-skylib/pull/643"
    },
    {
      "repo": "bazelbuild/bazel-skylib",
      "number": 647,
      "title": "Recommend execpath in run_binary",
      "head": "f64c8d9fa0898a9041ac6d1b996eca99f0a34ee5",
      "state": "open",
      "summary": "Buildifier documentation/parser compatibility; recorded inside Skylib #641.",
      "parent": [
        "bazelbuild/bazel-skylib",
        641
      ],
      "relation": "includes",
      "id": "pr:bazelbuild/bazel-skylib:647",
      "type": "pr",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazelbuild/bazel-skylib/pull/647"
    },
    {
      "repo": "bazelbuild/bazel-skylib",
      "number": 644,
      "title": "Accept native tag inputs in build_test",
      "head": "dc432570bb651ab14df44e33db75877da55ec17e",
      "state": "open",
      "summary": "Separate runtime tags compatibility fix extracted from #641; not an established landing prerequisite.",
      "id": "pr:bazelbuild/bazel-skylib:644",
      "type": "pr",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazelbuild/bazel-skylib/pull/644"
    },
    {
      "repo": "bazelbuild/rules_cc",
      "number": 960,
      "title": "Use public Bazel Features compatibility flag",
      "head": "e64ff1bf4df7e8f8f728db44c35181d31247a57a",
      "state": "closed",
      "summary": "Closed without merging. Do not count the compatibility-proxy change as landed.",
      "id": "pr:bazelbuild/rules_cc:960",
      "type": "pr",
      "group": "community",
      "status": "closed",
      "url": "https://github.com/bazelbuild/rules_cc/pull/960"
    },
    {
      "repo": "bazelbuild/rules_cc",
      "number": 967,
      "title": "Allow header-only Objective-C compilation artifacts",
      "head": "a39dcb143af056cc8eb0736ce39c933e3f7a38a2",
      "state": "open",
      "summary": "Runtime empty-source handling and actionable missing-factory error; related to rules_cc typing, not a proven blocker.",
      "id": "pr:bazelbuild/rules_cc:967",
      "type": "pr",
      "group": "community",
      "status": "open",
      "url": "https://github.com/bazelbuild/rules_cc/pull/967"
    },
    {
      "repo": "bazelbuild/starlark",
      "number": 362,
      "title": "Specify Starlark annotation syntax",
      "state": "open",
      "summary": "Open language-spec proposal includes namespaced type names used by Buck2. Syntax only: it does not specify checking semantics. sty field-map, openness and record semantics remain extensions.",
      "id": "pr:bazelbuild/starlark:362",
      "type": "pr",
      "group": "language",
      "status": "open",
      "url": "https://github.com/bazelbuild/starlark/pull/362"
    },
    {
      "repo": "bazelbuild/starlark",
      "number": 318,
      "title": "Align Collection, Sequence and Iterable",
      "state": "merged",
      "summary": "Merged 2025-09-02. sty already follows Collection for iterables and Sequence for indexed/sliced containers. A landed specification does not prove every host implementation conforms.",
      "id": "pr:bazelbuild/starlark:318",
      "type": "pr",
      "group": "language",
      "status": "merged",
      "url": "https://github.com/bazelbuild/starlark/pull/318"
    },
    {
      "id": "issue:bazelbuild/bazel:32381",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32381,
      "title": "Express a hashability bound on a generic type parameter",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32381",
      "summary": "Skylib collections.uniq preserves element types but must reject nested unhashable inputs. Bound syntax is rejected; do not equate an unconstrained generic with a safe dictionary key.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32379",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32379,
      "title": "Describe predicates that narrow a caller’s argument type",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32379",
      "summary": "Skylib types.is_string and types.is_list need caller narrowing that preserves list element types. A boolean return alone does not supply this contract.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32377",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32377,
      "title": "Reference a provider type without introducing a load cycle",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32377",
      "summary": "DirectoryInfo helpers cannot load their calling provider module only for annotations without a cycle; moving a provider changes its defining-label identity.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32370",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32370,
      "title": "Describe the fields a helper reads from a host object",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32370",
      "summary": "A helper requiring readable ctx.file or bazel_module fields cannot accept the real host object through an open struct contract. Distinct from rule callback inference.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32369",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32369,
      "title": "Type-check ctx.attr against the attributes declared on a rule",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32369",
      "summary": "The native checker accepts assigning attr.bool() to str and reading misspelled ctx.attr fields. Infer callback context from the declaration instead of repeating its schema.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32343",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32343,
      "title": "Type forwarded keyword arguments in Starlark macros",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32343",
      "summary": "Ordinary **kwargs wrappers hide required-argument and value-type errors. sty prototypes Unpack[KeywordArgs[callee]]; symbolic macro inherit_attrs is a different mechanism.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32311",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32311,
      "title": "Expose an annotation type for repository paths",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32311",
      "summary": "repository_ctx.path() values cannot be named as path or Path in native annotations.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32207",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32207,
      "title": "Allow Starlark provider declarations to specify field types",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32207",
      "summary": "Native provider(fields=...) assigns Any to fields and misses wrong returns. sty accepts source field comments and companion provider contracts.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32104",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32104,
      "title": "Annotate parameters with finite sets of strings",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32104",
      "summary": "platforms_contrib accepts x86-64 levels v1–v4, but native annotations cannot express Literal strings and reject v5 statically.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32086",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32086,
      "title": "Allow AnalysisTestResultInfo as an annotation type",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32086",
      "summary": "The native checker rejects the public analysis-test result constructor as a type.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32085",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32085,
      "title": "Expose the type of a rule’s provider values",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32085",
      "summary": "list[struct] admits ctx.outputs although analysis rejects it as a provider. Provider constructors and provider instances need distinct contracts.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32059",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32059,
      "title": "Accept iterable OutputGroupInfo values as Collection",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32059",
      "summary": "OutputGroupInfo iterates keys and is accepted by native visibility but rejected at a Collection annotation. Starlark #318 already merged the collection distinction.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32044",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32044,
      "title": "Support recursive type aliases",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32044",
      "summary": "A recursive Json alias cannot resolve its own list/dictionary references in the native checker.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32024",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32024,
      "title": "Accept real Target values in dynamic type checking",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32024",
      "summary": "Native dynamic annotation checking rejects dependency and source-file Targets. Disabling dynamic checking makes the reproduced analysis succeed; this is separate from static inference.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32022",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32022,
      "title": "Narrow optional lists after a None guard",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32022",
      "summary": "The native checker still treats a guarded list[str] as list[str] | None. This blocks using native annotations throughout the netrc parser, not its current type-comment fix.\n\nThe current prerelease still reproduces this report. Prepare a concise confirmation for Tamir review; nothing has been posted.\n\nRetested 2026-11-20: official Bazel 10.0.0rc4 rejects the original guarded for-loop under --experimental_starlark_type_checking; the same module loads without that flag. Bazel 9.3.3 accepts both commands, which does not establish a fix in the newer checker.",
      "evidence": [
        {
          "label": "Current Bazel reproduction",
          "url": "https://app.buildbuddy.io/invocation/4549ead0-7c3d-441e-98d9-2334aa8ba52a"
        }
      ]
    },
    {
      "id": "issue:bazelbuild/bazel:32021",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32021,
      "title": "Support depset element types in annotations",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32021",
      "summary": "Bare depset is accepted, but depset[str] is rejected as a nullary type constructor; collection payload contracts need parameterization.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "issue:bazelbuild/bazel:32020",
      "type": "issue",
      "repo": "bazelbuild/bazel",
      "number": 32020,
      "title": "Expose module and repository context annotation types",
      "group": "bazel",
      "status": "Feedback filed",
      "url": "https://github.com/bazelbuild/bazel/issues/32020",
      "summary": "Ctx exists for rule callbacks, while module_ctx and repository_ctx are absent from the native annotation environment.\n\nRetest the published reproduction on current Bazel before proposing follow-up feedback.\n\nThe issue is open; its original reproduction has not been rerun against current Bazel.",
      "evidence": []
    },
    {
      "id": "branch:intersection-attribute-presence",
      "type": "branch",
      "repo": "tamird/ruff",
      "title": "[ty] Refine missing intersection write warnings",
      "group": "ty",
      "status": "Awaiting Tamir review",
      "ref": "review/intersection-warning-presence-20261128",
      "url": "https://github.com/tamird/ruff/commit/4eed4b5f819b499b447ddefa4bb8fbc63cf7853a",
      "evidence": [
        {
          "label": "Qualified warning-only revision",
          "url": "https://github.com/tamird/ruff/commit/4eed4b5f819b499b447ddefa4bb8fbc63cf7853a"
        },
        {
          "label": "Held broad lookup migration fe5dca952",
          "url": "https://github.com/tamird/ruff/commit/fe5dca952cd0512660fde0ce150beb59b48c96bb"
        },
        {
          "label": "Full Bazel/RBE tests and concrete receiver-storage controls",
          "url": "https://app.buildbuddy.io/invocation/644dd1fa-7ee1-47b4-a435-184c3c838179"
        },
        {
          "label": "Matched optimized timings for ordinary and warning-producing writes",
          "url": "https://app.buildbuddy.io/invocation/b25f80a3-6fcc-4993-9107-71f9f06e7ed5"
        },
        {
          "label": "Earlier lookup-migration optimized timings",
          "url": "https://app.buildbuddy.io/invocation/815f8f39-3af0-4bf8-a990-71583bda0f24"
        }
      ],
      "head": "4eed4b5f819b499b447ddefa4bb8fbc63cf7853a",
      "summary": "Check concrete presence only when an intersection write would report a possibly missing attribute.\n\nThe existing attributes fixture, all 532 Markdown tests, scratch receiver-storage controls, native suites, formatting, and strict Clippy passed on RBE. Matched optimized medians were 80.81 ms upstream and 80.55 ms for 2,800 ordinary writes, and 43.87 ms upstream and 44.22 ms for 200 writes whose warnings still fire. Samples overlapped in both runs.\n\nThis proposal is not approved for upstream submission.",
      "contributorReview": {
        "kind": "proposal",
        "status": "pending",
        "head": "4eed4b5f819b499b447ddefa4bb8fbc63cf7853a",
        "baseHead": "aacccdff29525ed04398d400f4444a478f15d6aa",
        "url": "https://github.com/tamird/ruff/commit/4eed4b5f819b499b447ddefa4bb8fbc63cf7853a",
        "title": "Review the warning-only intersection fix",
        "summary": "Check concrete presence only when an intersection write would report a possibly missing attribute.",
        "body": "The cumulative diff is 3 files, 146 insertions and 12 deletions. The earlier lookup migration was 10 files, 964 insertions and 397 deletions. This version checks static class declarations or concrete receiver storage only at a pending intersection-write warning. It reuses raw MRO lookup and leaves the warning when that lookup cannot prove presence. The scratch control distinguishes bare dynamic fallback from declared instance storage, including storage annotated Any. Cases relying solely on metaclass-generated namespace storage or a union of intersection receivers retain the existing warning.\n\nThe existing attributes fixture, all 532 Markdown tests, scratch receiver-storage controls, native suites, formatting, and strict Clippy passed on RBE. Matched optimized medians were 80.81 ms upstream and 80.55 ms for 2,800 ordinary writes, and 43.87 ms upstream and 44.22 ms for 200 writes whose warnings still fire. Samples overlapped in both runs.\n\n`git range-diff --no-color --no-dual-color --creation-factor=999 fe5dca952cd0512660fde0ce150beb59b48c96bb^! 4eed4b5f819b499b447ddefa4bb8fbc63cf7853a^!`\n\n```diff\n1:  fe5dca952c ! 1:  4eed4b5f81 [ty] Carry presence through member lookup\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Carry presence through member lookup\n    +    [ty] Refine missing intersection write warnings\n     \n    -    An intersection can guarantee an attribute even if the assignment\n    -    uses a member that only defines it conditionally. Keep the concrete\n    -    presence fact during lookup so write validation can combine the\n    -    facts before reporting a possibly missing attribute.\n    +    A write to an intersection could report a possibly missing attribute\n    +    when one arm defined it conditionally and another guaranteed it.\n     \n    -    Lookup retains presence before dynamic fallback supplies a usable\n    -    type. Class namespace and metaclass lookup keep that distinction.\n    -    If dispatch skipped receiver storage and the warning still depends\n    -    on it, inspect that storage without resolving the class member again.\n    +    When reporting that warning, look for a definite member in the\n    +    static class MRO or concrete receiver storage. An Any base can\n    +    supply a write target without establishing presence. Check the\n    +    instance storage independently so an annotation on the receiver can\n    +    still prove that the attribute is present.\n     \n      ## crates/ty_python_semantic/resources/mdtest/attributes.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/attributes.md: def _(flag: bool):\n    @@ crates/ty_python_semantic/resources/mdtest/attributes.md: def _(flag: bool):\n          # Same for class objects\n          def inner2_class(a_and_b: Intersection[type[A2], type[B1]]):\n     \n    - ## crates/ty_python_semantic/src/types.rs ##\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    -     ) -> Option<PlaceAndQualifiers<'db>> {\n    -+        self.find_name_in_mro_with_presence(db, env, name, policy)\n    -+            .map(|lookup| lookup.member)\n    -+    }\n    -+\n    -+    fn find_name_in_mro_with_presence(\n    -+        &self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+    ) -> Option<class::ClassMemberLookup<'db>> {\n    -         if let Some(fallback) = (*self).materialized_divergent_fallback() {\n    --            return fallback.find_name_in_mro_with_policy(db, env, name, policy);\n    -+            return fallback.find_name_in_mro_with_presence(db, env, name, policy);\n    -         }\n    - \n    -         match self {\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -                 unreachable!(\"semantic operation on an unbound recursive variable\")\n    -             }\n    -             Type::Union(union) => {\n    --                Some(union.map_with_boundness_and_qualifiers(db, env, |elem| {\n    --                    elem.find_name_in_mro_with_policy(db, env, name, policy)\n    --                        // If some elements are classes, and some are not, we simply fall back to `Unbound` for the non-class\n    --                        // elements instead of short-circuiting the whole result to `None`. We would need a more detailed\n    --                        // return type otherwise, and since `find_name_in_mro` is usually called via `class_member`, this is\n    --                        // not a problem.\n    --                        .unwrap_or_default()\n    --                }))\n    -+                let mut declared_presence = true;\n    -+                let member = union.map_with_boundness_and_qualifiers(db, env, |elem| {\n    -+                    let lookup = elem\n    -+                        .find_name_in_mro_with_presence(db, env, name, policy)\n    -+                        .unwrap_or_default();\n    -+                    declared_presence &= lookup.declared_presence;\n    -+                    lookup.member\n    -+                });\n    -+                Some(class::ClassMemberLookup {\n    -+                    member,\n    -+                    declared_presence,\n    -+                })\n    -             }\n    -             Type::Intersection(inter) => {\n    --                Some(inter.map_with_boundness_and_qualifiers(db, env, |elem| {\n    --                    elem.find_name_in_mro_with_policy(db, env, name, policy)\n    --                        // Fall back to Unbound, similar to the union case (see above).\n    --                        .unwrap_or_default()\n    --                }))\n    -+                let mut declared_presence = false;\n    -+                let member = inter.map_with_boundness_and_qualifiers(db, env, |elem| {\n    -+                    let lookup = elem\n    -+                        .find_name_in_mro_with_presence(db, env, name, policy)\n    -+                        .unwrap_or_default();\n    -+                    declared_presence |= lookup.declared_presence;\n    -+                    lookup.member\n    -+                });\n    -+                Some(class::ClassMemberLookup {\n    -+                    member,\n    -+                    declared_presence,\n    -+                })\n    -             }\n    - \n    -             Type::Dynamic(_) | Type::Divergent(_) if policy.require_concrete() => {\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    - \n    -             Type::Recursive(recursive) => recursive\n    -                 .unfold(db, env)\n    --                .map(|unfolded| unfolded.find_name_in_mro_with_policy(db, env, name, policy))\n    --                .unwrap_or(Some(Place::bound(self).into())),\n    -+                .map(|unfolded| unfolded.find_name_in_mro_with_presence(db, env, name, policy))\n    -+                .unwrap_or(Some(class::ClassMemberLookup::unproven(\n    -+                    Place::bound(self).into(),\n    -+                ))),\n    - \n    --            Type::Dynamic(_) | Type::Divergent(_) | Type::Never => Some(Place::bound(self).into()),\n    -+            Type::Dynamic(_) | Type::Divergent(_) | Type::Never => Some(\n    -+                class::ClassMemberLookup::unproven(Place::bound(self).into()),\n    -+            ),\n    - \n    -             Type::ClassLiteral(class) if class.is_typed_dict(db) => {\n    --                Some(class.typed_dict_member(db, env, None, name, policy))\n    -+                Some(class.typed_dict_member(db, env, None, name, policy).into())\n    -             }\n    - \n    -             Type::ClassLiteral(class) => {\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    - \n    -                     _ => Some(\n    -                         class\n    --                            .class_member(db, env, name, policy)\n    -+                            .class_member_with_presence(db, env, name, policy)\n    -                             .map_type(|member| property_wrapper_descriptor(db, env, name, member)),\n    -                     ),\n    -                 }\n    -             }\n    - \n    --            Type::GenericAlias(alias) if alias.is_typed_dict(db) => {\n    --                Some(alias.origin(db).typed_dict_member(\n    --                    db,\n    --                    env,\n    --                    Some(alias.specialization(db)),\n    --                    name,\n    --                    policy,\n    --                ))\n    --            }\n    -+            Type::GenericAlias(alias) if alias.is_typed_dict(db) => Some(\n    -+                alias\n    -+                    .origin(db)\n    -+                    .typed_dict_member(db, env, Some(alias.specialization(db)), name, policy)\n    -+                    .into(),\n    -+            ),\n    - \n    -             Type::GenericAlias(alias) => Some(\n    -                 ClassType::from(*alias)\n    --                    .class_member(db, env, name, policy)\n    -+                    .class_member_with_presence(db, env, name, policy)\n    -                     .map_type(|member| property_wrapper_descriptor(db, env, name, member)),\n    -             ),\n    - \n    -             Type::SubclassOf(subclass_of_ty) => {\n    --                subclass_of_ty.find_name_in_mro_with_policy(db, env, name, policy)\n    -+                subclass_of_ty.find_name_in_mro_with_presence(db, env, name, policy)\n    -             }\n    - \n    -             // Note: `super(pivot, owner).__class__` is `builtins.super`, not the owner's class.\n    -             // `BoundSuper` should look up the name in the MRO of `builtins.super`.\n    -             Type::BoundSuper(_) => KnownClass::Super\n    -                 .to_class_literal(db, env)\n    --                .find_name_in_mro_with_policy(db, env, name, policy),\n    -+                .find_name_in_mro_with_presence(db, env, name, policy),\n    - \n    -             // We eagerly normalize type[object], i.e. Type::SubclassOf(object) to `type`,\n    -             // i.e. Type::NominalInstance(type). So looking up a name in the MRO of\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -                 } else {\n    -                     KnownClass::Object\n    -                         .to_class_literal(db, env)\n    --                        .find_name_in_mro_with_policy(db, env, name, policy)\n    -+                        .find_name_in_mro_with_presence(db, env, name, policy)\n    -                 }\n    -             }\n    - \n    -             Type::TypeAlias(alias) => alias\n    -                 .value_type(db)\n    --                .find_name_in_mro_with_policy(db, env, name, policy),\n    -+                .find_name_in_mro_with_presence(db, env, name, policy),\n    - \n    -             Type::FunctionLiteral(_)\n    -             | Type::Callable(_)\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_member_with_presence(db, env, name, policy)\n    -+            .member\n    -+    }\n    -+\n    -+    fn class_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+    ) -> class::ClassMemberLookup<'db> {\n    -         Self::class_member_with_policy_inner(\n    -             db,\n    -             MemberLookupKey::new(\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    - \n    -     #[salsa::tracked(\n    -         returns(copy),\n    --        cycle_initial=|_, id, _, _| Place::bound(Type::divergent(id)).into(),\n    --        cycle_fn=|db, cycle, previous: &PlaceAndQualifiers<'db>, member: PlaceAndQualifiers<'db>, key: MemberLookupKey<'db>| {\n    --            member.cycle_normalized(db, &ProgramEnvironment::from_program(key.program(db)), *previous, cycle)\n    -+        cycle_initial=|_, id, _, _| class::ClassMemberLookup::unproven(Place::bound(Type::divergent(id)).into()),\n    -+        cycle_fn=|db, cycle, previous: &class::ClassMemberLookup<'db>, member: class::ClassMemberLookup<'db>, key: MemberLookupKey<'db>| {\n    -+            let normalized = member.member.cycle_normalized(db, &ProgramEnvironment::from_program(key.program(db)), previous.member, cycle);\n    -+            class::ClassMemberLookup {\n    -+                member: normalized,\n    -+                declared_presence: member.declared_presence && class::ClassMemberLookup::from(normalized).declared_presence,\n    -+            }\n    -         },\n    -         heap_size=ruff_memory_usage::heap_size\n    -     )]\n    -     fn class_member_with_policy_inner(\n    -         db: &'db dyn Db,\n    -         key: MemberLookupKey<'db>,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> class::ClassMemberLookup<'db> {\n    -         let ty = key.ty(db);\n    -         let name = key.name(db);\n    -         let policy = key.policy(db);\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    - \n    -         tracing::trace!(\"class_member: {}.{}\", ty.display(db, env), name);\n    -         if let Some(fallback) = ty.materialized_divergent_fallback() {\n    --            return fallback.class_member_with_policy(db, env, name, policy);\n    -+            return fallback.class_member_with_presence(db, env, name, policy);\n    -         }\n    -         if name == \"__hash__\"\n    -             && let Type::ProtocolInstance(protocol) = ty\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -             && interface.includes_member(db, \"__eq__\")\n    -         {\n    -             return if interface.includes_member(db, name) {\n    --                interface.instance_member(db, env, name)\n    -+                interface.instance_member(db, env, name).into()\n    -             } else {\n    --                Self::unspecified_protocol_hash(db, env, policy)\n    -+                Self::unspecified_protocol_hash(db, env, policy).into()\n    -             };\n    -         }\n    -         if let Type::ProtocolInstance(protocol) = ty\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         {\n    -             let interface = protocol.interface(db);\n    -             return if interface.includes_member(db, name) {\n    --                interface.instance_member(db, env, name)\n    -+                interface.instance_member(db, env, name).into()\n    -             } else {\n    --                Type::instance(db, env, *origin).class_member_with_policy(db, env, name, policy)\n    -+                Type::instance(db, env, *origin).class_member_with_presence(db, env, name, policy)\n    -             };\n    -         }\n    - \n    -         match ty {\n    --            Type::Union(union) => union.map_with_boundness_and_qualifiers(db, env, |elem| {\n    --                elem.class_member_with_policy(db, env, name, policy)\n    --            }),\n    --            Type::Intersection(inter) => inter.map_with_boundness_and_qualifiers(db, env, |elem| {\n    --                elem.class_member_with_policy(db, env, name, policy)\n    --            }),\n    -+            Type::Union(union) => {\n    -+                let mut declared_presence = true;\n    -+                let member = union.map_with_boundness_and_qualifiers(db, env, |elem| {\n    -+                    let lookup = elem.class_member_with_presence(db, env, name, policy);\n    -+                    declared_presence &= lookup.declared_presence;\n    -+                    lookup.member\n    -+                });\n    -+                class::ClassMemberLookup {\n    -+                    member,\n    -+                    declared_presence,\n    -+                }\n    -+            }\n    -+            Type::Intersection(inter) => {\n    -+                let mut declared_presence = false;\n    -+                let member = inter.map_with_boundness_and_qualifiers(db, env, |elem| {\n    -+                    let lookup = elem.class_member_with_presence(db, env, name, policy);\n    -+                    declared_presence |= lookup.declared_presence;\n    -+                    lookup.member\n    -+                });\n    -+                class::ClassMemberLookup {\n    -+                    member,\n    -+                    declared_presence,\n    -+                }\n    -+            }\n    -             Type::TypedDict(TypedDictType::Synthesized(synthesized)) => {\n    -                 class::synthesized_typed_dict_class_member(db, env, synthesized, policy, name)\n    -+                    .into()\n    -             }\n    -             // TODO: Remove this once synthesized protocols have a precise meta-type.\n    -             Type::ProtocolInstance(protocol) if protocol.class_origin(db).is_none() => {\n    --                ty.instance_member(db, env, name)\n    -+                ty.instance_member(db, env, name).into()\n    -             }\n    - \n    -             Type::LiteralValue(literal)\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -             Type::SubclassOf(subclass_of) if subclass_of.is_dynamic() => {\n    -                 let type_result = KnownClass::Type\n    -                     .to_class_literal(db, env)\n    --                    .find_name_in_mro_with_policy(db, env, name, policy)\n    -+                    .find_name_in_mro_with_presence(db, env, name, policy)\n    -                     .expect(\"`find_name_in_mro` should return `Some` for a class literal\");\n    --                if !type_result.place.is_undefined() {\n    -+                if !type_result.member.place.is_undefined() {\n    -                     type_result\n    -                 } else {\n    -                     ty.to_meta_type(db, env)\n    --                        .find_name_in_mro_with_policy(db, env, name, policy)\n    -+                        .find_name_in_mro_with_presence(db, env, name, policy)\n    -                         .expect(\n    -                             \"`Type::find_name_in_mro()` should return `Some()` \\\n    -                             when called on a meta-type\",\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -                 }\n    -             }\n    - \n    --            Type::NominalInstance(instance) => ty.to_meta_type(db, env).class_namespace_member(\n    --                db,\n    --                env,\n    --                instance.class(db, env),\n    --                name,\n    --                policy,\n    --            ),\n    -+            Type::NominalInstance(instance) => ty\n    -+                .to_meta_type(db, env)\n    -+                .class_namespace_member_with_presence(\n    -+                    db,\n    -+                    env,\n    -+                    instance.class(db, env),\n    -+                    name,\n    -+                    policy,\n    -+                ),\n    - \n    -             Type::ClassLiteral(_) | Type::GenericAlias(_) | Type::SubclassOf(_) => ty\n    -                 .to_meta_type(db, env)\n    --                .class_object_member(db, env, name, policy),\n    -+                .class_object_member_with_presence(db, env, name, policy),\n    - \n    -             _ => ty\n    -                 .to_meta_type(db, env)\n    --                .find_name_in_mro_with_policy(db, env, name, policy)\n    -+                .find_name_in_mro_with_presence(db, env, name, policy)\n    -                 .expect(\n    -                     \"`Type::find_name_in_mro()` should return `Some()` \\\n    -                     when called on a meta-type\",\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         if let Some(literal) = ty.literal_member_representative(key.name(db)) {\n    -             return literal.class_member_with_policy(db, env, key.name(db), key.policy(db));\n    -         }\n    --        Self::class_member_with_policy_inner(db, key)\n    -+        Self::class_member_with_policy_inner(db, key).member\n    -     }\n    - \n    -     /// Look up attributes stored in the namespace of a class object.\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_object_member_with_presence(db, env, name, policy)\n    -+            .member\n    -+    }\n    -+\n    -+    fn class_object_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+    ) -> class::ClassMemberLookup<'db> {\n    -         let class_attr = self\n    --            .find_name_in_mro_with_policy(db, env, name, policy)\n    -+            .find_name_in_mro_with_presence(db, env, name, policy)\n    -             .expect(\n    -                 \"Calling `class_object_member` on class literals and subclass-of types \\\n    -                 should always find an MRO\",\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         else {\n    -             return class_attr;\n    -         };\n    --        let metaclass_attr = metaclass_instance.instance_member(db, env, name);\n    -+        let metaclass_attr = metaclass_instance.instance_member_with_presence(db, env, name);\n    - \n    -         if own_declaration_definedness.is_some() {\n    -             // A conditionally-declared attribute is a contract only on paths where that\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_namespace_member_with_presence(db, env, class, name, policy)\n    -+            .member\n    -+    }\n    -+\n    -+    fn class_namespace_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        class: ClassType<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+    ) -> class::ClassMemberLookup<'db> {\n    -         let class_attr = self\n    --            .find_name_in_mro_with_policy(db, env, name, policy)\n    -+            .find_name_in_mro_with_presence(db, env, name, policy)\n    -             .expect(\"The meta-type of an instance-like type should always have an MRO\");\n    -         let Some(metaclass) = class\n    -             .inferred_metaclass(db)\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         else {\n    -             return class_attr;\n    -         };\n    --        let metaclass_member = metaclass.instance_member(db, env, name);\n    --        if metaclass_member.is_undefined() {\n    -+        let metaclass_member = metaclass.instance_member_with_presence(db, env, name);\n    -+        if metaclass_member.member.is_undefined() {\n    -             return class_attr;\n    -         }\n    -         let metaclass_member_is_implicit = metaclass_member\n    -+            .member\n    -             .qualifiers\n    -             .contains(TypeQualifiers::IMPLICIT_INSTANCE_ATTRIBUTE);\n    - \n    --        let own_class_member = class.class_literal(db).class_member_from_mro(\n    -+        let own_class_member = class.class_literal(db).class_member_from_mro_with_presence(\n    -             db,\n    -             env,\n    -             name,\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         );\n    -         // A non-ClassVar declaration-only member describes instance storage but does not add a\n    -         // value to the class namespace.\n    --        let own_class_member = if !own_class_member.is_class_var()\n    -+        let own_class_member = if !own_class_member.member.is_class_var()\n    -             && class.static_class_literal(db).is_some_and(|(class, _)| {\n    -                 let scope = class.body_scope(db);\n    -                 place_table(db, scope)\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -                         .is_undefined()\n    -                     })\n    -             }) {\n    --            PlaceAndQualifiers::default()\n    -+            class::ClassMemberLookup::default()\n    -         } else {\n    -             own_class_member\n    -         };\n    --        let inherited_class_member = class.class_literal(db).class_member_from_mro(\n    -+        let inherited_class_member = class.class_literal(db).class_member_from_mro_with_presence(\n    -             db,\n    -             env,\n    -             name,\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         );\n    - \n    -         let metaclass_member = if metaclass_member_is_implicit {\n    --            Self::with_definedness(metaclass_member, Definedness::PossiblyUndefined)\n    -+            class::ClassMemberLookup {\n    -+                member: Self::with_definedness(\n    -+                    metaclass_member.member,\n    -+                    Definedness::PossiblyUndefined,\n    -+                ),\n    -+                declared_presence: metaclass_member.declared_presence,\n    -+            }\n    -         } else {\n    -             metaclass_member\n    -         };\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         let class_member = if metaclass_member_is_implicit {\n    -             // Preserve the existing convention that an inferred instance member is assumed to be\n    -             // available even when no lower-precedence fallback exists.\n    --            Self::with_definedness(class_member, Definedness::AlwaysDefined)\n    -+            class::ClassMemberLookup {\n    -+                member: Self::with_definedness(class_member.member, Definedness::AlwaysDefined),\n    -+                declared_presence: class_member.declared_presence || metaclass_member_is_implicit,\n    -+            }\n    -         } else {\n    -             class_member\n    -         };\n    -         if policy.no_instance_fallback() || policy.require_concrete() {\n    -             return class_member;\n    -         }\n    --        let Some(dynamic_instance_type) = class.iter_mro(db).find_map(|base| match base {\n    --            ClassBase::Any | ClassBase::Dynamic(_) | ClassBase::Divergent(_) => {\n    --                Some(Type::from(base))\n    --            }\n    --            _ => None,\n    --        }) else {\n    --            return class_member;\n    --        };\n    --        let dynamic_instance_fallback = Place::bound(dynamic_instance_type).into();\n    -+        let declared_presence = class_member.declared_presence;\n    -+        let member = (|| {\n    -+            let class_member = class_member.member;\n    -+            let Some(dynamic_instance_type) = class.iter_mro(db).find_map(|base| match base {\n    -+                ClassBase::Any | ClassBase::Dynamic(_) | ClassBase::Divergent(_) => {\n    -+                    Some(Type::from(base))\n    -+                }\n    -+                _ => None,\n    -+            }) else {\n    -+                return class_member;\n    -+            };\n    -+            let dynamic_instance_fallback = Place::bound(dynamic_instance_type).into();\n    - \n    --        // A dynamic base can provide arbitrary instance storage that shadows non-data class\n    --        // attributes. Preserve only the data-descriptor alternatives before falling back to the\n    --        // actual dynamic type.\n    --        let Some(class_member_ty) = class_member.ignore_possibly_undefined() else {\n    --            return dynamic_instance_fallback;\n    --        };\n    --        if !class_member_ty.may_be_data_descriptor(db, env) {\n    --            return dynamic_instance_fallback;\n    -+            // A dynamic base can provide arbitrary instance storage that shadows non-data class\n    -+            // attributes. Preserve only the data-descriptor alternatives before falling back to the\n    -+            // actual dynamic type.\n    -+            let Some(class_member_ty) = class_member.ignore_possibly_undefined() else {\n    -+                return dynamic_instance_fallback;\n    -+            };\n    -+            if !class_member_ty.may_be_data_descriptor(db, env) {\n    -+                return dynamic_instance_fallback;\n    -+            }\n    -+            let PlaceAndQualifiers {\n    -+                place: Place::Defined(declaration),\n    -+                qualifiers,\n    -+            } = class_member\n    -+            else {\n    -+                return dynamic_instance_fallback;\n    -+            };\n    -+            let mut all_arms_are_possible_data_descriptors = true;\n    -+            let descriptor_ty = declaration.ty.filter_union(db, env, |ty| {\n    -+                let is_possible_data_descriptor = ty.may_be_data_descriptor(db, env);\n    -+                all_arms_are_possible_data_descriptors &= is_possible_data_descriptor;\n    -+                is_possible_data_descriptor\n    -+            });\n    -+            Place::Defined(DefinedPlace {\n    -+                ty: descriptor_ty,\n    -+                definedness: if all_arms_are_possible_data_descriptors {\n    -+                    declaration.definedness\n    -+                } else {\n    -+                    Definedness::PossiblyUndefined\n    -+                },\n    -+                ..declaration\n    -+            })\n    -+            .with_qualifiers(qualifiers)\n    -+            .or_fall_back_to(db, env, || dynamic_instance_fallback)\n    -+        })();\n    -+        class::ClassMemberLookup {\n    -+            member,\n    -+            declared_presence,\n    -         }\n    --        let PlaceAndQualifiers {\n    --            place: Place::Defined(declaration),\n    --            qualifiers,\n    --        } = class_member\n    --        else {\n    --            return dynamic_instance_fallback;\n    --        };\n    --        let mut all_arms_are_possible_data_descriptors = true;\n    --        let descriptor_ty = declaration.ty.filter_union(db, env, |ty| {\n    --            let is_possible_data_descriptor = ty.may_be_data_descriptor(db, env);\n    --            all_arms_are_possible_data_descriptors &= is_possible_data_descriptor;\n    --            is_possible_data_descriptor\n    --        });\n    --        Place::Defined(DefinedPlace {\n    --            ty: descriptor_ty,\n    --            definedness: if all_arms_are_possible_data_descriptors {\n    --                declaration.definedness\n    --            } else {\n    --                Definedness::PossiblyUndefined\n    --            },\n    --            ..declaration\n    --        })\n    --        .with_qualifiers(qualifiers)\n    --        .or_fall_back_to(db, env, || dynamic_instance_fallback)\n    -     }\n    - \n    -     /// This function roughly corresponds to looking up an attribute in the `__dict__` of an object.\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.instance_member_with_presence(db, env, name).member\n    -+    }\n    -+\n    -+    fn instance_member_with_presence(\n    -+        &self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+    ) -> class::ClassMemberLookup<'db> {\n    -         match self {\n    -             Type::RecursiveVar(_) => {\n    -                 unreachable!(\"semantic operation on an unbound recursive variable\")\n    -             }\n    --            Type::Union(union) => union.map_with_boundness_and_qualifiers(db, env, |elem| {\n    --                elem.instance_member(db, env, name)\n    --            }),\n    -+            Type::Union(union) => {\n    -+                let mut declared_presence = true;\n    -+                let member = union.map_with_boundness_and_qualifiers(db, env, |elem| {\n    -+                    let lookup = elem.instance_member_with_presence(db, env, name);\n    -+                    declared_presence &= lookup.declared_presence;\n    -+                    lookup.member\n    -+                });\n    -+                class::ClassMemberLookup {\n    -+                    member,\n    -+                    declared_presence,\n    -+                }\n    -+            }\n    - \n    -             Type::Intersection(intersection) => {\n    -                 if let Some(complement) = intersection.enum_complement(db, env) {\n    --                    enums::instance_member_for_enum_complement(db, env, complement, name)\n    -+                    enums::instance_member_for_enum_complement(db, env, complement, name).into()\n    -                 } else {\n    --                    intersection.map_with_boundness_and_qualifiers(db, env, |elem| {\n    --                        elem.instance_member(db, env, name)\n    --                    })\n    -+                    let mut declared_presence = false;\n    -+                    let member = intersection.map_with_boundness_and_qualifiers(db, env, |elem| {\n    -+                        let lookup = elem.instance_member_with_presence(db, env, name);\n    -+                        declared_presence |= lookup.declared_presence;\n    -+                        lookup.member\n    -+                    });\n    -+                    class::ClassMemberLookup {\n    -+                        member,\n    -+                        declared_presence,\n    -+                    }\n    -                 }\n    -             }\n    - \n    -             Type::EnumComplement(complement) => {\n    --                enums::instance_member_for_enum_complement(db, env, *complement, name)\n    -+                enums::instance_member_for_enum_complement(db, env, *complement, name).into()\n    -             }\n    - \n    -             Type::Recursive(recursive) => recursive\n    -                 .unfold(db, env)\n    --                .map(|unfolded| unfolded.instance_member(db, env, name))\n    --                .unwrap_or(Place::bound(self).into()),\n    --\n    --            Type::Dynamic(_) | Type::Divergent(_) | Type::Never => Place::bound(self).into(),\n    -+                .map(|unfolded| unfolded.instance_member_with_presence(db, env, name))\n    -+                .unwrap_or(class::ClassMemberLookup::unproven(\n    -+                    Place::bound(self).into(),\n    -+                )),\n    - \n    --            Type::NominalInstance(instance) => {\n    --                instance.class(db, env).instance_member(db, env, name)\n    -+            Type::Dynamic(_) | Type::Divergent(_) | Type::Never => {\n    -+                class::ClassMemberLookup::unproven(Place::bound(self).into())\n    -             }\n    -+\n    -+            Type::NominalInstance(instance) => instance\n    -+                .class(db, env)\n    -+                .instance_member_with_presence(db, env, name),\n    -             Type::NewTypeInstance(newtype) => newtype\n    -                 .concrete_base_type(db)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    --            Type::ProtocolInstance(protocol) => protocol.instance_member(db, env, name),\n    -+            Type::ProtocolInstance(protocol) => protocol.instance_member(db, env, name).into(),\n    - \n    -             Type::FunctionLiteral(function) => function\n    -                 .runtime_class(db)\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             Type::BoundMethod(_) => KnownClass::MethodType\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    -             Type::KnownBoundMethod(method) => method\n    -                 .class()\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    -             Type::WrapperDescriptor(_) => KnownClass::WrapperDescriptorType\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    -             Type::DataclassDecorator(_) => KnownClass::FunctionType\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    -             Type::Callable(_) | Type::DataclassTransformer(_) => {\n    --                Type::object().instance_member(db, env, name)\n    -+                Type::object().instance_member_with_presence(db, env, name)\n    -             }\n    - \n    -             Type::TypeVar(bound_typevar) => {\n    -                 match bound_typevar.require_bound_or_constraints(db, env) {\n    -                     TypeVarBoundOrConstraints::UpperBound(bound) => {\n    --                        bound.instance_member(db, env, name)\n    -+                        bound.instance_member_with_presence(db, env, name)\n    -+                    }\n    -+                    TypeVarBoundOrConstraints::Constraints(constraints) => {\n    -+                        let mut declared_presence = true;\n    -+                        let member =\n    -+                            constraints.map_with_boundness_and_qualifiers(db, env, |constraint| {\n    -+                                let lookup =\n    -+                                    constraint.instance_member_with_presence(db, env, name);\n    -+                                declared_presence &= lookup.declared_presence;\n    -+                                lookup.member\n    -+                            });\n    -+                        class::ClassMemberLookup {\n    -+                            member,\n    -+                            declared_presence,\n    -+                        }\n    -                     }\n    --                    TypeVarBoundOrConstraints::Constraints(constraints) => constraints\n    --                        .map_with_boundness_and_qualifiers(db, env, |constraint| {\n    --                            constraint.instance_member(db, env, name)\n    --                        }),\n    -                 }\n    -             }\n    - \n    -             Type::TypeIs(_) | Type::TypeGuard(_) => KnownClass::Bool\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             Type::LiteralValue(literal) => literal\n    -                 .fallback_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             Type::AlwaysTruthy | Type::AlwaysFalsy | Type::TypeForm(_) => {\n    --                Type::object().instance_member(db, env, name)\n    -+                Type::object().instance_member_with_presence(db, env, name)\n    -             }\n    -             Type::ModuleLiteral(_) => KnownClass::ModuleType\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             Type::SpecialForm(_) | Type::KnownInstance(_) => Place::Undefined.into(),\n    - \n    -             Type::PropertyInstance(property) => property\n    -                 .instance_class(db)\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             Type::SlotDescriptor(_) => KnownClass::MemberDescriptorType\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             // Note: `super(pivot, owner).__dict__` refers to the `__dict__` of the `builtins.super` instance,\n    -             // not that of the owner.\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -             // refer to [`Type::member`] instead.\n    -             Type::BoundSuper(_) => KnownClass::Super\n    -                 .to_instance(db, env)\n    --                .instance_member(db, env, name),\n    -+                .instance_member_with_presence(db, env, name),\n    - \n    -             // TODO: we currently don't model the fact that class literals and subclass-of types have\n    -             // a `__dict__` that is filled with class level attributes. Modeling this is currently not\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    - \n    -             Type::TypedDict(_) => Place::Undefined.into(),\n    - \n    --            Type::TypeAlias(alias) => alias.value_type(db).instance_member(db, env, name),\n    -+            Type::TypeAlias(alias) => alias\n    -+                .value_type(db)\n    -+                .instance_member_with_presence(db, env, name),\n    -         }\n    -     }\n    - \n    -\n    - ## crates/ty_python_semantic/src/types/attribute_write.rs ##\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: pub(super) enum AttributeWriteRequirement<'db> {\n    -         object_ty: Type<'db>,\n    -         receiver: Option<Type<'db>>,\n    -         member: InstanceAttributeWriteMember<'db>,\n    -+        declared_presence: AttributePresence,\n    -     },\n    -     /// A write through a class object, resolved against its metaclass and class attributes.\n    -     Class {\n    -         object_ty: Type<'db>,\n    -         member: ClassAttributeWriteMember<'db>,\n    -+        declared_presence: AttributePresence,\n    -     },\n    - }\n    - \n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: impl<'db> AttributeWriteRequirement<'db> {\n    -             object_ty,\n    -             receiver,\n    -             member: InstanceAttributeWriteMember::SetAttr,\n    -+            declared_presence: _,\n    -         } = self\n    -         else {\n    -             return None;\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: pub(super) enum AttributeWriteFailure<'db> {\n    -     },\n    - }\n    - \n    -+/// Presence retained from raw write-member lookup, before descriptor interpretation.\n    -+#[derive(Clone, Copy)]\n    -+pub(super) enum AttributePresence {\n    -+    Present,\n    -+    Missing,\n    -+    /// Dispatch was settled before receiver storage needed to be queried.\n    -+    UncheckedReceiver,\n    -+}\n    -+\n    -+impl AttributePresence {\n    -+    fn from_members(members: Option<&AssignmentAttributeMembers<'_>>) -> Self {\n    -+        match members {\n    -+            Some(\n    -+                AssignmentAttributeMembers::TypeMember {\n    -+                    member: _,\n    -+                    receiver_fallback: _,\n    -+                    declared_presence,\n    -+                }\n    -+                | AssignmentAttributeMembers::ReceiverMember {\n    -+                    member: _,\n    -+                    declared_presence,\n    -+                },\n    -+            ) => *declared_presence,\n    -+            None => Self::Missing,\n    -+        }\n    -+    }\n    -+\n    -+    /// Query skipped receiver storage only when a composite write needs its presence.\n    -+    pub(super) fn is_declared<'db>(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        object_ty: Type<'db>,\n    -+        attribute: &str,\n    -+        class_object: bool,\n    -+    ) -> bool {\n    -+        match self {\n    -+            Self::Present => true,\n    -+            Self::Missing => false,\n    -+            Self::UncheckedReceiver => {\n    -+                if class_object {\n    -+                    object_ty\n    -+                        .class_object_member_with_presence(\n    -+                            db,\n    -+                            env,\n    -+                            attribute,\n    -+                            MemberLookupPolicy::default(),\n    -+                        )\n    -+                        .declared_presence\n    -+                } else {\n    -+                    object_ty\n    -+                        .instance_member_with_presence(db, env, attribute)\n    -+                        .declared_presence\n    -+                }\n    -+            }\n    -+        }\n    -+    }\n    -+}\n    -+\n    - /// How a writable protocol member validates an assigned value.\n    - pub(super) enum ProtocolMemberWriteRequirement<'db> {\n    -     /// Check the assigned value against a directly representable write type.\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: pub(super) enum AssignmentAttributeMembers<'db> {\n    -     TypeMember {\n    -         member: PlaceAndQualifiers<'db>,\n    -         receiver_fallback: Option<PlaceAndQualifiers<'db>>,\n    -+        declared_presence: AttributePresence,\n    -     },\n    -     /// The receiver member governs the write, as `C.plain` does above because `Meta.plain` is\n    -     /// definitely not a data descriptor.\n    --    ReceiverMember(PlaceAndQualifiers<'db>),\n    -+    ReceiverMember {\n    -+        member: PlaceAndQualifiers<'db>,\n    -+        declared_presence: AttributePresence,\n    -+    },\n    - }\n    - \n    - impl<'db> AssignmentAttributeMembers<'db> {\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: impl<'db> AssignmentAttributeMembers<'db> {\n    -     pub(super) fn type_member(self) -> Option<PlaceAndQualifiers<'db>> {\n    -         match self {\n    -             Self::TypeMember { member, .. } => Some(member),\n    --            Self::ReceiverMember(_) => None,\n    -+            Self::ReceiverMember {\n    -+                member: _,\n    -+                declared_presence: _,\n    -+            } => None,\n    -         }\n    -     }\n    - \n    -     pub(super) fn receiver_member(&self) -> Option<&PlaceAndQualifiers<'db>> {\n    -         match self {\n    --            Self::ReceiverMember(member) => Some(member),\n    -+            Self::ReceiverMember {\n    -+                member,\n    -+                declared_presence: _,\n    -+            } => Some(member),\n    -             Self::TypeMember {\n    -                 receiver_fallback, ..\n    -             } => receiver_fallback.as_ref(),\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn instance_attribute_write_requirement<'db>(\n    -     receiver: Option<Type<'db>>,\n    -     members: Option<&AssignmentAttributeMembers<'db>>,\n    - ) -> AttributeWriteRequirement<'db> {\n    -+    let declared_presence = AttributePresence::from_members(members);\n    -     let instance = |member| AttributeWriteRequirement::Instance {\n    -         object_ty,\n    -         receiver,\n    -         member,\n    -+        declared_presence,\n    -     };\n    -     let fallback_requirement = |member| {\n    -         instance_fallback_write_requirement(db, env, object_ty, attribute, member, receiver)\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn instance_attribute_write_requirement<'db>(\n    -         Some(&AssignmentAttributeMembers::TypeMember {\n    -             member,\n    -             receiver_fallback,\n    -+            declared_presence: _,\n    -         }) => (member, receiver_fallback),\n    --        Some(&AssignmentAttributeMembers::ReceiverMember(member)) => {\n    -+        Some(&AssignmentAttributeMembers::ReceiverMember {\n    -+            member,\n    -+            declared_presence: _,\n    -+        }) => {\n    -             return instance(InstanceAttributeWriteMember::Instance(\n    -                 fallback_requirement(member),\n    -             ));\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn class_attribute_write_requirement<'db>(\n    -     let Some(class_attr_self_ty) = object_ty.to_instance_approximation(db, env) else {\n    -         return AttributeWriteRequirement::Unconstrained;\n    -     };\n    -+    let declared_presence = AttributePresence::from_members(Some(&members));\n    -     let (type_member, receiver_fallback) = match members {\n    -         AssignmentAttributeMembers::TypeMember {\n    -             member,\n    -             receiver_fallback,\n    -+            declared_presence: _,\n    -         } => (member, receiver_fallback),\n    --        AssignmentAttributeMembers::ReceiverMember(member) => {\n    -+        AssignmentAttributeMembers::ReceiverMember {\n    -+            member,\n    -+            declared_presence: _,\n    -+        } => {\n    -             return AttributeWriteRequirement::Class {\n    -                 object_ty,\n    -+                declared_presence,\n    -                 member: ClassAttributeWriteMember::ClassAttribute(\n    -                     class_fallback_write_requirement(\n    -                         db,\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn class_attribute_write_requirement<'db>(\n    -                 };\n    -                 return AttributeWriteRequirement::Class {\n    -                     object_ty,\n    -+                    declared_presence,\n    -                     member: ClassAttributeWriteMember::ClassAttribute(\n    -                         instance_fallback_write_requirement(\n    -                             db, env, object_ty, attribute, member, None,\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn class_attribute_write_requirement<'db>(\n    -         },\n    -     };\n    - \n    --    AttributeWriteRequirement::Class { object_ty, member }\n    -+    AttributeWriteRequirement::Class {\n    -+        object_ty,\n    -+        member,\n    -+        declared_presence,\n    -+    }\n    - }\n    - \n    - /// Recover the concrete descriptor hidden by an uncertain metaclass-member annotation.\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn class_object_assignment_members<'db>(\n    -     env: &ProgramEnvironment<'db>,\n    -     object_ty: Type<'db>,\n    -     attribute: &str,\n    --    type_member: PlaceAndQualifiers<'db>,\n    -+    lookup: super::class::ClassMemberLookup<'db>,\n    - ) -> Option<AssignmentAttributeMembers<'db>> {\n    -     if !matches!(\n    -         object_ty,\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn class_object_assignment_members<'db>(\n    -         return None;\n    -     }\n    - \n    -+    let type_member = lookup.member;\n    -     let type_member_ty = type_member.place.ignore_possibly_undefined()?;\n    -     let definitely_non_data_descriptor = type_member_ty.is_definitely_non_data_descriptor(db, env);\n    -     if !definitely_non_data_descriptor\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: fn class_object_assignment_members<'db>(\n    -     }\n    - \n    -     let receiver_member = object_ty\n    --        .find_name_in_mro_with_policy(db, env, attribute, MemberLookupPolicy::default())\n    --        .filter(|class_attr| !class_attr.place.is_undefined())?;\n    -+        .find_name_in_mro_with_presence(db, env, attribute, MemberLookupPolicy::default())\n    -+        .filter(|class_attr| !class_attr.member.place.is_undefined())?;\n    - \n    -+    let declared_presence = if lookup.declared_presence || receiver_member.declared_presence {\n    -+        AttributePresence::Present\n    -+    } else {\n    -+        AttributePresence::Missing\n    -+    };\n    -     Some(if definitely_non_data_descriptor {\n    --        AssignmentAttributeMembers::ReceiverMember(receiver_member)\n    -+        AssignmentAttributeMembers::ReceiverMember {\n    -+            member: receiver_member.member,\n    -+            declared_presence,\n    -+        }\n    -     } else {\n    -         AssignmentAttributeMembers::TypeMember {\n    -             member: type_member,\n    --            receiver_fallback: Some(receiver_member),\n    -+            receiver_fallback: Some(receiver_member.member),\n    -+            declared_presence,\n    -         }\n    -     })\n    - }\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: pub(super) fn assignment_attribute_members<'db>(\n    - ) -> Option<AssignmentAttributeMembers<'db>> {\n    -     // Precise `functools.partial` instances synthesize a refined `__call__` member instead of\n    -     // using the broad signature from typeshed.\n    --    let type_member = if attribute == \"__call__\"\n    -+    let lookup = if attribute == \"__call__\"\n    -         && matches!(\n    -             object_ty,\n    -             Type::KnownInstance(KnownInstanceType::FunctoolsPartial(_))\n    -         ) {\n    --        object_ty.member(db, env, attribute)\n    -+        super::class::ClassMemberLookup::from(object_ty.member(db, env, attribute))\n    -     } else if let Type::ProtocolInstance(protocol) = object_ty\n    -         && let Some(origin) = protocol.materialized_origin_property(db, attribute)\n    -     {\n    --        Type::instance(db, env, *origin).class_member(db, env, attribute)\n    -+        Type::instance(db, env, *origin).class_member_with_presence(\n    -+            db,\n    -+            env,\n    -+            attribute,\n    -+            MemberLookupPolicy::default(),\n    -+        )\n    -     } else {\n    --        object_ty.class_member(db, env, attribute)\n    -+        object_ty.class_member_with_presence(db, env, attribute, MemberLookupPolicy::default())\n    -     };\n    --    if let Some(members) =\n    --        class_object_assignment_members(db, env, object_ty, attribute, type_member)\n    --    {\n    -+    if let Some(members) = class_object_assignment_members(db, env, object_ty, attribute, lookup) {\n    -         return Some(members);\n    -     }\n    -+    let type_member = lookup.member;\n    -     let needs_receiver_fallback = matches!(\n    -         type_member.place,\n    -         Place::Defined(DefinedPlace {\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: pub(super) fn assignment_attribute_members<'db>(\n    -             | Type::TypeGuard(_)\n    -             | Type::TypeForm(_)\n    -             | Type::TypedDict(_)\n    --            | Type::NewTypeInstance(_) => object_ty.instance_member(db, env, attribute),\n    --            Type::ClassLiteral(..) | Type::GenericAlias(..) | Type::SubclassOf(..) => {\n    --                object_ty.class_object_member(db, env, attribute, MemberLookupPolicy::default())\n    -+            | Type::NewTypeInstance(_) => {\n    -+                object_ty.instance_member_with_presence(db, env, attribute)\n    -             }\n    -+            Type::ClassLiteral(..) | Type::GenericAlias(..) | Type::SubclassOf(..) => object_ty\n    -+                .class_object_member_with_presence(\n    -+                    db,\n    -+                    env,\n    -+                    attribute,\n    -+                    MemberLookupPolicy::default(),\n    -+                ),\n    -             Type::Union(..)\n    -             | Type::Intersection(..)\n    -             | Type::TypeAlias(..)\n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: pub(super) fn assignment_attribute_members<'db>(\n    -     } else {\n    -         None\n    -     };\n    -+    let declared_presence = if lookup.declared_presence\n    -+        || receiver_fallback.is_some_and(|member| member.declared_presence)\n    -+    {\n    -+        AttributePresence::Present\n    -+    } else if needs_receiver_fallback {\n    -+        AttributePresence::Missing\n    -+    } else {\n    -+        AttributePresence::UncheckedReceiver\n    -+    };\n    -     Some(AssignmentAttributeMembers::TypeMember {\n    -         member: type_member,\n    --        receiver_fallback,\n    -+        receiver_fallback: receiver_fallback.map(|lookup| lookup.member),\n    -+        declared_presence,\n    -     })\n    - }\n    - \n    -@@ crates/ty_python_semantic/src/types/attribute_write.rs: impl<'c, 'db> TypeRelationChecker<'_, 'c, 'db> {\n    -                 object_ty,\n    -                 receiver,\n    -                 member,\n    -+                declared_presence: _,\n    -             } => self.check_instance_attribute_write(\n    -                 db,\n    -                 *object_ty,\n    -\n      ## crates/ty_python_semantic/src/types/class.rs ##\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassLiteral<'db> {\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_member_with_presence(db, env, name, policy)\n    -+            .member\n    -+    }\n    -+\n    -+    pub(super) fn class_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+    ) -> ClassMemberLookup<'db> {\n    -         match self {\n    --            Self::Static(class) => class.class_member(db, env, name, policy),\n    --            Self::Dynamic(class) => class.class_member(db, env, name, policy),\n    --            Self::DynamicNamedTuple(namedtuple) => namedtuple.class_member(db, env, name, policy),\n    --            Self::DynamicTypedDict(typeddict) => typeddict.class_member(db, env, name, policy),\n    --            Self::DynamicEnum(enum_lit) => enum_lit.class_member(db, env, name, policy),\n    -+            Self::Static(class) => {\n    -+                class.class_member_inner_with_presence(db, env, None, name, policy)\n    -+            }\n    -+            Self::Dynamic(class) => class.class_member_with_presence(db, env, name, policy),\n    -+            Self::DynamicNamedTuple(namedtuple) => {\n    -+                namedtuple.class_member_with_presence(db, env, name, policy)\n    -+            }\n    -+            Self::DynamicTypedDict(typeddict) => {\n    -+                typeddict.class_member(db, env, name, policy).into()\n    -+            }\n    -+            Self::DynamicEnum(enum_lit) => {\n    -+                enum_lit.class_member_with_presence(db, env, name, policy)\n    -+            }\n    -         }\n    -     }\n    - \n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassLiteral<'db> {\n    -         policy: MemberLookupPolicy,\n    -         mro_iter: impl Iterator<Item = ClassBase<'db>>,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_member_from_mro_with_presence(db, env, name, policy, mro_iter)\n    -+            .member\n    -+    }\n    -+\n    -+    pub(super) fn class_member_from_mro_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+        mro_iter: impl Iterator<Item = ClassBase<'db>>,\n    -+    ) -> ClassMemberLookup<'db> {\n    -         match self {\n    --            Self::Static(class) => class.class_member_from_mro(db, env, name, policy, mro_iter),\n    -+            Self::Static(class) => {\n    -+                class.class_member_from_mro_with_presence(db, env, name, policy, mro_iter)\n    -+            }\n    -             Self::Dynamic(_)\n    -             | Self::DynamicNamedTuple(_)\n    -             | Self::DynamicTypedDict(_)\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassLiteral<'db> {\n    -                     ClassMemberResult::Done(result) => result.finalize(db, env),\n    -                     ClassMemberResult::TypedDict(module) => {\n    -                         typed_dict::typed_dict_fallback_class_member(db, env, module, policy, name)\n    -+                            .into()\n    -                     }\n    -                 }\n    -             }\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassLiteral<'db> {\n    -         specialization: Option<Specialization<'db>>,\n    -         name: &str,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.instance_member_with_presence(db, env, specialization, name)\n    -+            .member\n    -+    }\n    -+\n    -+    pub(super) fn instance_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        specialization: Option<Specialization<'db>>,\n    -+        name: &str,\n    -+    ) -> ClassMemberLookup<'db> {\n    -         match self {\n    --            Self::Static(class) => class.instance_member(db, env, specialization, name),\n    --            Self::Dynamic(class) => class.instance_member(db, env, name),\n    --            Self::DynamicNamedTuple(namedtuple) => namedtuple.instance_member(db, env, name),\n    --            Self::DynamicTypedDict(_) => PlaceAndQualifiers::default(),\n    --            Self::DynamicEnum(enum_lit) => enum_lit.instance_member(db, env, name),\n    -+            Self::Static(class) => {\n    -+                class.instance_member_with_presence(db, env, specialization, name)\n    -+            }\n    -+            Self::Dynamic(class) => class.instance_member_with_presence(db, env, name),\n    -+            Self::DynamicNamedTuple(namedtuple) => {\n    -+                namedtuple.instance_member_with_presence(db, env, name)\n    -+            }\n    -+            Self::DynamicTypedDict(_) => ClassMemberLookup::default(),\n    -+            Self::DynamicEnum(enum_lit) => enum_lit.instance_member_with_presence(db, env, name),\n    -         }\n    -     }\n    - \n     @@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassType<'db> {\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_member_with_presence(db, env, name, policy)\n    -+            .member\n    -+    }\n    -+\n    -+    pub(super) fn class_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+    ) -> ClassMemberLookup<'db> {\n    -         match self {\n    --            Self::NonGeneric(class) => class.class_member(db, env, name, policy),\n    --            Self::Generic(generic) => generic.origin(db).class_member_inner(\n    -+            Self::NonGeneric(class) => class.class_member_with_presence(db, env, name, policy),\n    -+            Self::Generic(generic) => generic.origin(db).class_member_inner_with_presence(\n    -                 db,\n    -                 env,\n    -                 Some(generic.specialization(db)),\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassType<'db> {\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.instance_member_with_presence(db, env, name).member\n    -+    }\n    -+\n    -+    pub(super) fn instance_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        name: &str,\n    -+    ) -> ClassMemberLookup<'db> {\n    -         match self {\n    --            Self::NonGeneric(ClassLiteral::Dynamic(class)) => class.instance_member(db, env, name),\n    -+            Self::NonGeneric(ClassLiteral::Dynamic(class)) => {\n    -+                class.instance_member_with_presence(db, env, name)\n    -+            }\n    -             Self::NonGeneric(ClassLiteral::DynamicNamedTuple(namedtuple)) => {\n    --                namedtuple.instance_member(db, env, name)\n    -+                namedtuple.instance_member_with_presence(db, env, name)\n    -             }\n    --            Self::NonGeneric(ClassLiteral::DynamicTypedDict(_)) => PlaceAndQualifiers::default(),\n    -+            Self::NonGeneric(ClassLiteral::DynamicTypedDict(_)) => ClassMemberLookup::default(),\n    -             Self::NonGeneric(ClassLiteral::DynamicEnum(enum_lit)) => {\n    --                enum_lit.instance_member(db, env, name)\n    -+                enum_lit.instance_member_with_presence(db, env, name)\n    -             }\n    -             Self::NonGeneric(ClassLiteral::Static(class)) => {\n    --                class.instance_member(db, env, None, name)\n    -+                class.instance_member_with_presence(db, env, None, name)\n    -             }\n    -             Self::Generic(generic) => {\n    -                 let class_literal = generic.origin(db);\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> ClassType<'db> {\n    -                 // Applying the receiver's specialization again would also substitute type\n    -                 // variables inside the replacement types. For example, applying `T -> list[T]`\n    -                 // twice changes an attribute's type from `list[T]` to `list[list[T]]`.\n    --                class_literal.instance_member(db, env, specialization, name)\n    -+                class_literal.instance_member_with_presence(db, env, specialization, name)\n    -             }\n    -         }\n    -     }\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -     ) -> ClassMemberResult<'db> {\n    -         let db = self.db;\n    - \n    -+        let mut declared_presence = false;\n    -         let mut dynamic_type: Option<Type<'db>> = None;\n    -         let mut lookup_result: LookupResult<'db> =\n    -             Err(LookupError::Undefined(TypeQualifiers::empty()));\n    -         let mut pending_augmented_bindings = Vec::new();\n    - \n    -         for superclass in self.mro_iter {\n    -+            let dispatch_complete = lookup_result.is_ok();\n    -             match superclass {\n    -                 ClassBase::Generic | ClassBase::Protocol => {\n    -                     // Skip over these very special class bases that aren't really classes.\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                     // Note: calling `Type::from(superclass).member()` would be incorrect here.\n    -                     // What we'd really want is a `Type::Any.own_class_member()` method,\n    -                     // but adding such a method wouldn't make much sense -- it would always return `Any`!\n    --                    dynamic_type.get_or_insert(Type::from(superclass));\n    -+                    if !dispatch_complete {\n    -+                        dynamic_type.get_or_insert(Type::from(superclass));\n    -+                    }\n    -                 }\n    -                 ClassBase::Divergent(_) => {\n    --                    dynamic_type.get_or_insert(Type::from(superclass));\n    -+                    if !dispatch_complete {\n    -+                        dynamic_type.get_or_insert(Type::from(superclass));\n    -+                    }\n    -                 }\n    -                 ClassBase::Class(class) => {\n    -                     let known = class.known(db);\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                         continue;\n    -                     }\n    - \n    -+                    let (own_member, own_declared_presence) = match class {\n    -+                        ClassType::NonGeneric(ClassLiteral::Dynamic(dynamic)) => {\n    -+                            dynamic.own_class_member_with_presence(db, name)\n    -+                        }\n    -+                        _ => {\n    -+                            let member = class.own_class_member(\n    -+                                db,\n    -+                                &self.env,\n    -+                                inherited_generic_context,\n    -+                                name,\n    -+                            );\n    -+                            let declared_presence =\n    -+                                ClassMemberLookup::from(member.inner).declared_presence;\n    -+                            (member, declared_presence)\n    -+                        }\n    -+                    };\n    -+                    declared_presence |= own_declared_presence;\n    -+                    if dispatch_complete {\n    -+                        if declared_presence {\n    -+                            break;\n    -+                        }\n    -+                        continue;\n    -+                    }\n    -                     let implicit = class.member_with_augmented_bindings(\n    -                         db,\n    --                        class.own_class_member(db, &self.env, inherited_generic_context, name),\n    -+                        own_member,\n    -                         name,\n    -                         MethodDecorator::ClassMethod,\n    -                     );\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                     }\n    - \n    -                     let mut member = implicit.member.inner;\n    -+                    declared_presence |=\n    -+                        own_declared_presence && ClassMemberLookup::from(member).declared_presence;\n    -                     if let Place::Defined(defined) = &mut member.place\n    -                         && !pending_augmented_bindings.is_empty()\n    -                     {\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                     });\n    -                 }\n    -                 ClassBase::TypedDict(module) => {\n    --                    return ClassMemberResult::TypedDict(module);\n    -+                    if !dispatch_complete {\n    -+                        return ClassMemberResult::TypedDict(module);\n    -+                    }\n    -                 }\n    -             }\n    --            if lookup_result.is_ok() {\n    -+            if lookup_result.is_ok() && declared_presence {\n    -                 break;\n    -             }\n              }\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -         ClassMemberResult::Done(CompletedMemberLookup {\n    -             lookup_result,\n    -             dynamic_type,\n    -+            declared_presence,\n    -         })\n          }\n      \n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -         // Collect the inputs in MRO order so their normalization can be reused.\n    -         let mut types = SmallVec::<[Type<'db>; 1]>::new();\n    -         let mut known_nonempty = false;\n    -+        let mut declared_presence = false;\n    -         let combined_type = |types: &[Type<'db>]| {\n    -             if types.is_empty() {\n    -                 return Type::Never;\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                     // We already return the dynamic type for class member lookup, so we can\n    -                     // just return unbound here (to avoid having to build a union of the\n    -                     // dynamic type with itself).\n    --                    return InstanceMemberResult::Done(PlaceAndQualifiers::unbound());\n    -+                    return InstanceMemberResult::Done(ClassMemberLookup::unproven(\n    -+                        PlaceAndQualifiers::unbound(),\n    -+                    ));\n    -                 }\n    -                 ClassBase::Class(class) => {\n    -                     let member = class.own_instance_member(db, &self.env, name);\n    -+                    let concrete_member = !matches!(\n    -+                        class,\n    -+                        ClassType::NonGeneric(ClassLiteral::DynamicNamedTuple(_))\n    -+                    );\n    -+                    declared_presence |=\n    -+                        concrete_member && ClassMemberLookup::from(member.inner).declared_presence;\n    -                     let definitely_declared = matches!(\n    -                         member.inner.place,\n    -                         Place::Defined(place) if place.is_definitely_defined()\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                         if !overriding_class_default {\n    -                             // Annotations take precedence over inferred writes, including augmented\n    -                             // assignments. Avoid inferring method bodies just to discard their types.\n    --                            return InstanceMemberResult::Done(member.inner);\n    -+                            return InstanceMemberResult::Done(ClassMemberLookup {\n    -+                                member: member.inner,\n    -+                                declared_presence,\n    -+                            });\n    -                         }\n    -                     }\n    - \n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -                             // Once a type contributes, later defaults cannot make the union\n    -                             // empty. Avoid interning a growing union at each default.\n    -                             if !known_nonempty && combined_type(&types) == Type::Never {\n    --                                return InstanceMemberResult::Done(class_member.inner);\n    -+                                return InstanceMemberResult::Done(ClassMemberLookup {\n    -+                                    member: class_member.inner,\n    -+                                    declared_presence,\n    -+                                });\n    -                             }\n    -                             known_nonempty = true;\n    - \n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db, I: Iterator<Item = ClassBase<'db>>> MroLookup<'db, I> {\n    -             .with_qualifiers(union_qualifiers)\n    -         };\n    - \n    --        InstanceMemberResult::Done(result)\n    -+        InstanceMemberResult::Done(ClassMemberLookup {\n    -+            member: result,\n    -+            declared_presence,\n    -+        })\n    -     }\n    - }\n    - \n    -@@ crates/ty_python_semantic/src/types/class.rs: pub(super) enum ClassMemberResult<'db> {\n    -     TypedDict(TypingModule),\n    - }\n    - \n    -+/// A member's dispatch value and presence established by concrete declarations.\n    -+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, get_size2::GetSize, salsa::SalsaValue)]\n    -+pub(super) struct ClassMemberLookup<'db> {\n    -+    pub(super) member: PlaceAndQualifiers<'db>,\n    -+    pub(super) declared_presence: bool,\n    -+}\n    -+\n    -+impl<'db> From<PlaceAndQualifiers<'db>> for ClassMemberLookup<'db> {\n    -+    fn from(member: PlaceAndQualifiers<'db>) -> Self {\n    -+        Self {\n    -+            declared_presence: member.place.is_definitely_bound()\n    -+                && !member\n    -+                    .ignore_possibly_undefined()\n    -+                    .is_some_and(|ty| ty.is_divergent()),\n    -+            member,\n    -+        }\n    -+    }\n    -+}\n    -+\n    -+impl<'db> From<Place<'db>> for ClassMemberLookup<'db> {\n    -+    fn from(place: Place<'db>) -> Self {\n    -+        PlaceAndQualifiers::from(place).into()\n    -+    }\n    -+}\n    -+\n    -+impl<'db> ClassMemberLookup<'db> {\n    -+    pub(super) fn unproven(member: PlaceAndQualifiers<'db>) -> Self {\n    -+        Self {\n    -+            member,\n    -+            declared_presence: false,\n    -+        }\n    -+    }\n    -+\n    -+    pub(super) fn map_type(self, f: impl FnOnce(Type<'db>) -> Type<'db>) -> Self {\n    -+        let Self {\n    -+            member,\n    -+            declared_presence,\n    -+        } = self;\n    -+        Self {\n    -+            member: member.map_type(f),\n    -+            declared_presence,\n    -+        }\n    -+    }\n    -+\n    -+    pub(super) fn or_fall_back_to(\n    ++    /// Prove presence from the class MRO without interpreting descriptors. Limit the proof\n    ++    /// to static names: functional classes can synthesize bound members for unknown names.\n    ++    pub(super) fn has_concrete_class_member(\n     +        self,\n     +        db: &'db dyn Db,\n     +        env: &ProgramEnvironment<'db>,\n    -+        fallback: impl FnOnce() -> Self,\n    -+    ) -> Self {\n    -+        let Self {\n    -+            member,\n    -+            declared_presence,\n    -+        } = self;\n    -+        if member.place.is_definitely_bound() && declared_presence {\n    -+            return self;\n    -+        }\n    -+        let fallback = fallback();\n    -+        Self {\n    -+            member: member.or_fall_back_to(db, env, || fallback.member),\n    -+            declared_presence: declared_presence || fallback.declared_presence,\n    -+        }\n    -+    }\n    -+}\n    -+\n    - pub(super) struct CompletedMemberLookup<'db> {\n    -     lookup_result: LookupResult<'db>,\n    -     dynamic_type: Option<Type<'db>>,\n    -+    declared_presence: bool,\n    - }\n    - \n    - impl<'db> CompletedMemberLookup<'db> {\n    -     /// Finalize the lookup result by handling dynamic type intersection.\n    --    fn finalize(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>) -> PlaceAndQualifiers<'db> {\n    --        match (\n    --            PlaceAndQualifiers::from(self.lookup_result),\n    --            self.dynamic_type,\n    --        ) {\n    -+    fn finalize(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>) -> ClassMemberLookup<'db> {\n    -+        let Self {\n    -+            lookup_result,\n    -+            dynamic_type,\n    -+            declared_presence,\n    -+        } = self;\n    -+        let concrete_member = PlaceAndQualifiers::from(lookup_result);\n    -+        let member = match (concrete_member, dynamic_type) {\n    -             (symbol_and_qualifiers, None) => symbol_and_qualifiers,\n    - \n    -             (\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> CompletedMemberLookup<'db> {\n    -                 },\n    -                 Some(dynamic),\n    -             ) => Place::bound(dynamic).with_qualifiers(qualifiers),\n    -+        };\n    -+        ClassMemberLookup {\n    -+            member,\n    -+            declared_presence,\n    -         }\n    -     }\n    - }\n    -@@ crates/ty_python_semantic/src/types/class.rs: impl<'db> CompletedMemberLookup<'db> {\n    - #[derive(Debug, Copy, Clone, PartialEq, Eq)]\n    - pub(super) enum InstanceMemberResult<'db> {\n    -     /// Found the member or exhausted the MRO\n    --    Done(PlaceAndQualifiers<'db>),\n    -+    Done(ClassMemberLookup<'db>),\n    -     /// Encountered a `TypedDict` base - caller should handle this specially\n    -     TypedDict,\n    - }\n    -\n    - ## crates/ty_python_semantic/src/types/class/dynamic_literal.rs ##\n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: use ruff_text_size::TextRange;\n    - \n    - use crate::{\n    -     Db, TypeQualifiers,\n    --    place::{Place, PlaceAndQualifiers},\n    -+    place::Place,\n    -     types::{\n    -         ClassBase, ClassLiteral, ClassType, DataclassParams, KnownClass, MemberLookupPolicy,\n    -         SubclassOfType, Type,\n    -         class::{\n    --            ClassMemberResult, ClassMetaclass, CodeGeneratorKind, DisjointBase,\n    -+            ClassMemberLookup, ClassMemberResult, ClassMetaclass, CodeGeneratorKind, DisjointBase,\n    -             DynamicClassHeaderAnchor, DynamicClassScopeOffset, InstanceMemberResult, MroLookup,\n    -             dynamic_class_header_range, typed_dict::typed_dict_fallback_class_member,\n    -         },\n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: impl<'db> DynamicClassLiteral<'db> {\n    -     }\n    - \n    -     /// Look up an instance member by iterating through the MRO.\n    --    pub(crate) fn instance_member(\n    -+    pub(super) fn instance_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> ClassMemberLookup<'db> {\n    -         match MroLookup::new(db, env, self.iter_mro(db)).instance_member(name) {\n    -             InstanceMemberResult::Done(result) => result,\n    -             InstanceMemberResult::TypedDict => {\n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: impl<'db> DynamicClassLiteral<'db> {\n    -                 KnownClass::TypedDictFallback\n    -                     .to_instance(db, env)\n    -                     .instance_member(db, env, name)\n    -+                    .into()\n    -             }\n    -         }\n    -     }\n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: impl<'db> DynamicClassLiteral<'db> {\n    -     /// Uses `MroLookup` with:\n    -     /// - No inherited generic context (dynamic classes aren't generic).\n    -     /// - `is_self_object = false` (dynamic classes are never `object`).\n    --    pub(crate) fn class_member(\n    -+    pub(in crate::types) fn class_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> ClassMemberLookup<'db> {\n    -         // Check if this dynamic class is dataclass-like (via dataclass_transform inheritance).\n    -         if CodeGeneratorKind::from_class(db, self.into())\n    -             .is_some_and(CodeGeneratorKind::is_dataclass_like)\n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: impl<'db> DynamicClassLiteral<'db> {\n    -                         KnownClass::Field.to_specialized_instance(db, env, &[Type::any()]),\n    -                     ],\n    -                 ))\n    --                .with_qualifiers(TypeQualifiers::CLASS_VAR);\n    -+                .with_qualifiers(TypeQualifiers::CLASS_VAR)\n    -+                .into();\n    -             } else if name == \"__dataclass_params__\" {\n    -                 // There is no typeshed class for this. For now, we model it as `Any`.\n    --                return Place::declared(Type::any()).with_qualifiers(TypeQualifiers::CLASS_VAR);\n    -+                return Place::declared(Type::any())\n    -+                    .with_qualifiers(TypeQualifiers::CLASS_VAR)\n    -+                    .into();\n    -             }\n    -         }\n    - \n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: impl<'db> DynamicClassLiteral<'db> {\n    -         match result {\n    -             ClassMemberResult::Done(result) => result.finalize(db, env),\n    -             ClassMemberResult::TypedDict(module) => {\n    --                typed_dict_fallback_class_member(db, env, module, policy, name)\n    -+                typed_dict_fallback_class_member(db, env, module, policy, name).into()\n    -             }\n    -         }\n    -     }\n    -@@ crates/ty_python_semantic/src/types/class/dynamic_literal.rs: impl<'db> DynamicClassLiteral<'db> {\n    -     /// Returns [`Member::unbound`] if the member is not found in the namespace dict,\n    -     /// unless the namespace is dynamic, in which case returns `Unknown`.\n    -     pub(super) fn own_class_member(self, db: &'db dyn Db, name: &str) -> Member<'db> {\n    --        // If the namespace is dynamic (not a literal dict) and the name isn't in `self.members`,\n    --        // return Unknown since we can't know what attributes might be defined.\n    --        self.members(db)\n    -+        self.own_class_member_with_presence(db, name).0\n    -+    }\n    -+\n    -+    pub(super) fn own_class_member_with_presence(\n    -+        self,\n    -+        db: &'db dyn Db,\n     +        name: &str,\n    -+    ) -> (Member<'db>, bool) {\n    -+        if let Some(ty) = self\n    -+            .members(db)\n    -             .iter()\n    -             .find_map(|(member_name, ty)| (name == member_name).then_some(*ty))\n    --            .or_else(|| self.has_dynamic_namespace(db).then(Type::unknown))\n    --            .map_or_default(Member::definitely_declared)\n    ++        for_instance: bool,\n    ++    ) -> bool {\n    ++        let mut policy = MemberLookupPolicy::REQUIRE_CONCRETE;\n    ++        if for_instance\n    ++            && name == \"__dict__\"\n    ++            && self\n    ++                .static_class_literal(db)\n    ++                .is_some_and(|(class, _)| class.lacks_instance_storage(db, name))\n     +        {\n    -+            return (Member::definitely_declared(ty), !ty.is_divergent());\n    ++            // As in ordinary instance lookup, the typeshed object.__dict__ fallback\n    ++            // does not describe storage on a slotted instance.\n    ++            policy |= MemberLookupPolicy::MRO_NO_OBJECT_FALLBACK;\n    ++        }\n    ++        let bases = self.iter_mro(db).filter(|base| {\n    ++            matches!(base, ClassBase::Class(class) if class.static_class_literal(db).is_some())\n    ++        });\n    ++        match MroLookup::new(db, env, bases).class_member(\n    ++            name,\n    ++            policy,\n    ++            None,\n    ++            self.known(db) == Some(KnownClass::Object),\n    ++        ) {\n    ++            ClassMemberResult::Done(CompletedMemberLookup {\n    ++                lookup_result: Ok(member),\n    ++                dynamic_type: _,\n    ++            }) => !member.inner_type().is_divergent(),\n    ++            _ => false,\n     +        }\n    -+        // An opaque namespace permits the attribute without declaring it.\n    -+        (\n    -+            self.has_dynamic_namespace(db)\n    -+                .then(Type::unknown)\n    -+                .map_or_default(Member::definitely_declared),\n    -+            false,\n    -+        )\n    -     }\n    - \n    -     /// Look up an instance member defined directly on this class (not inherited).\n    -\n    - ## crates/ty_python_semantic/src/types/class/enum_literal.rs ##\n    -@@ crates/ty_python_semantic/src/types/class/enum_literal.rs: use ruff_python_ast::name::Name;\n    - use ruff_text_size::TextRange;\n    - \n    - use crate::Db;\n    --use crate::place::{Place, PlaceAndQualifiers};\n    -+use crate::place::Place;\n    - use crate::types::class::known::KnownClass;\n    - use crate::types::class::{\n    --    ClassLiteral, ClassType, DynamicClassHeaderAnchor, DynamicClassScopeOffset, MemberLookupPolicy,\n    --    dynamic_class_header_range,\n    -+    ClassLiteral, ClassMemberLookup, ClassType, DynamicClassHeaderAnchor, DynamicClassScopeOffset,\n    -+    MemberLookupPolicy, dynamic_class_header_range,\n    - };\n    - use crate::types::class_base::ClassBase;\n    - use crate::types::member::Member;\n    -@@ crates/ty_python_semantic/src/types/class/enum_literal.rs: impl<'db> DynamicEnumLiteral<'db> {\n    -     fn with_unknown_member_fallback(\n    -         self,\n    -         db: &'db dyn Db,\n    --        result: PlaceAndQualifiers<'db>,\n    --    ) -> PlaceAndQualifiers<'db> {\n    --        if !self.has_known_members(db) && result.place.is_undefined() {\n    --            Place::bound(Type::unknown()).into()\n    -+        result: ClassMemberLookup<'db>,\n    -+    ) -> ClassMemberLookup<'db> {\n    -+        if !self.has_known_members(db) && result.member.is_undefined() {\n    -+            ClassMemberLookup::unproven(Place::bound(Type::unknown()).into())\n    -         } else {\n    -             result\n    -         }\n    -@@ crates/ty_python_semantic/src/types/class/enum_literal.rs: impl<'db> DynamicEnumLiteral<'db> {\n    -     /// The unknown-member fallback at the end does not consult `policy`. It exists to avoid false\n    -     /// `missing-attribute` errors when the member names are not statically known, which is a\n    -     /// property of the enum rather than of the lookup being performed.\n    --    pub(crate) fn class_member(\n    -+    pub(super) fn class_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> ClassMemberLookup<'db> {\n    -         let own = self.own_class_member(db, name);\n    -         if !own.is_undefined() {\n    --            return own.inner;\n    -+            return own.inner.into();\n    -         }\n    -         if let Some(mixin_class) = self.mixin_class(db, env) {\n    --            let result = mixin_class.class_member(db, env, name, policy);\n    --            if !result.place.is_undefined() {\n    -+            let result = mixin_class.class_member_with_presence(db, env, name, policy);\n    -+            if !result.member.is_undefined() {\n    -                 return result;\n    -             }\n    -         }\n    -@@ crates/ty_python_semantic/src/types/class/enum_literal.rs: impl<'db> DynamicEnumLiteral<'db> {\n    -             .base_class(db)\n    -             .to_class_literal(db, env)\n    -             .as_class_literal()\n    --            .map(|cls| cls.class_member(db, env, name, policy))\n    --            .unwrap_or_else(|| Place::Undefined.into());\n    -+            .map(|cls| cls.class_member_with_presence(db, env, name, policy))\n    -+            .unwrap_or_default();\n    - \n    -         // When members are unknown (e.g. `Enum(\"E\", some_var)`), any name could\n    -         // still be a member. Only fall back to `Unknown` after exhausting the\n    -@@ crates/ty_python_semantic/src/types/class/enum_literal.rs: impl<'db> DynamicEnumLiteral<'db> {\n    -     }\n    - \n    -     /// Look up an instance member by name, checking mixin and base class.\n    --    ///\n    --    /// If members are unknown and nothing was found, returns `Unknown`\n    --    /// as a last resort.\n    --    pub(crate) fn instance_member(\n    -+    /// If members are unknown and nothing was found, returns `Unknown` as a last resort.\n    -+    pub(in crate::types) fn instance_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> ClassMemberLookup<'db> {\n    -         if let Some(mixin_class) = self.mixin_class(db, env) {\n    --            let result = mixin_class.instance_member(db, env, name);\n    --            if !result.place.is_undefined() {\n    -+            let result = mixin_class.instance_member_with_presence(db, env, name);\n    -+            if !result.member.is_undefined() {\n    -                 return result;\n    -             }\n    -         }\n    -         let result = self\n    -             .base_class(db)\n    -             .to_instance(db, env)\n    --            .instance_member(db, env, name);\n    -+            .instance_member_with_presence(db, env, name);\n    - \n    -         self.with_unknown_member_fallback(db, result)\n    -     }\n    -\n    - ## crates/ty_python_semantic/src/types/class/named_tuple.rs ##\n    -@@ crates/ty_python_semantic/src/types/class/named_tuple.rs: use ruff_text_size::TextRange;\n    - \n    - use crate::{\n    -     Db,\n    --    place::{Place, PlaceAndQualifiers},\n    -+    place::Place,\n    -     types::{\n    -         BindingContext, BoundTypeVarInstance, ClassBase, ClassLiteral, ClassType, GenericContext,\n    -         KnownClass, KnownInstanceType, MemberLookupPolicy, Parameter, Parameters,\n    -         PropertyInstanceType, SelfTypeVarOrigin, Signature, SubclassOfType, Type, TypeContext,\n    -         TypeMapping,\n    --        class::{DynamicClassHeaderAnchor, DynamicClassScopeOffset, dynamic_class_header_range},\n    -+        class::{\n    -+            ClassMemberLookup, DynamicClassHeaderAnchor, DynamicClassScopeOffset,\n    -+            dynamic_class_header_range,\n    -+        },\n    -         definition_expression_type,\n    -         member::Member,\n    -         mro::Mro,\n    -@@ crates/ty_python_semantic/src/types/class/named_tuple.rs: impl<'db> DynamicNamedTupleLiteral<'db> {\n    -     }\n    - \n    -     /// Look up an instance member by name (including superclasses).\n    --    pub(crate) fn instance_member(\n    -+    pub(in crate::types) fn instance_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    --    ) -> PlaceAndQualifiers<'db> {\n    --        // First check own instance members.\n    --        let result = self.own_instance_member(db, name);\n    --        if !result.is_undefined() {\n    --            return result.inner;\n    -+    ) -> ClassMemberLookup<'db> {\n    -+        // Unknown fields permit arbitrary access without establishing a concrete declaration.\n    -+        if !self.has_known_fields(db) {\n    -+            return ClassMemberLookup::unproven(Place::declared(Type::any()).into());\n    -         }\n    - \n    --        // Fall back to the tuple base type for other attributes.\n    --        Type::instance(db, env, self.tuple_base_class(db, env)).instance_member(db, env, name)\n    -+        Type::instance(db, env, self.tuple_base_class(db, env))\n    -+            .instance_member_with_presence(db, env, name)\n    -     }\n    - \n    -     /// Look up a class-level member by name.\n    --    pub(crate) fn class_member(\n    -+    pub(super) fn class_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    --    ) -> PlaceAndQualifiers<'db> {\n    --        // First check synthesized members and fields.\n    -+    ) -> ClassMemberLookup<'db> {\n    -         let member = self.own_class_member(db, name);\n    -         if !member.is_undefined() {\n    --            return member.inner;\n    -+            return member.inner.into();\n    -         }\n    - \n    --        // Fall back to tuple class members.\n    -         let result = self\n    -             .tuple_base_class(db, env)\n    -             .class_literal(db)\n    --            .class_member(db, env, name, policy);\n    -+            .class_member_with_presence(db, env, name, policy);\n    - \n    --        // If fields are unknown (dynamic) and the attribute wasn't found,\n    --        // return `Any` instead of failing.\n    --        if !self.has_known_fields(db) && result.place.is_undefined() {\n    --            return Place::bound(Type::any()).into();\n    -+        if !self.has_known_fields(db) && result.member.is_undefined() {\n    -+            return ClassMemberLookup::unproven(Place::bound(Type::any()).into());\n    -         }\n    - \n    -         result\n    -\n    - ## crates/ty_python_semantic/src/types/class/static_literal.rs ##\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: use crate::{\n    -         call::{CallError, CallErrorKind},\n    -         callable::CallableTypeKind,\n    -         class::{\n    --            ClassInstanceFlags, ClassMemberResult, ClassMetaclass, CodeGeneratorKind, DisjointBase,\n    --            DynamicTypedDictLiteral, Field, FieldKind, InstanceMemberResult, MetaclassError,\n    --            MetaclassErrorKind, MethodDecorator, MroLookup, NamedTupleField,\n    --            synthesize_namedtuple_class_member,\n    -+            ClassInstanceFlags, ClassMemberLookup, ClassMemberResult, ClassMetaclass,\n    -+            CodeGeneratorKind, DisjointBase, DynamicTypedDictLiteral, Field, FieldKind,\n    -+            InstanceMemberResult, MetaclassError, MetaclassErrorKind, MethodDecorator, MroLookup,\n    -+            NamedTupleField, synthesize_namedtuple_class_member,\n    -             typed_dict::{TypedDictFields, synthesize_typed_dict_method, typed_dict_class_member},\n    -         },\n    -         context::InferContext,\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -     /// The member resolves to a member on the class itself or any of its proper superclasses.\n    -     ///\n    -     /// TODO: Should this be made private...?\n    --    pub(super) fn class_member(\n    --        self,\n    --        db: &'db dyn Db,\n    --        env: &ProgramEnvironment<'db>,\n    --        name: &str,\n    --        policy: MemberLookupPolicy,\n    --    ) -> PlaceAndQualifiers<'db> {\n    --        self.class_member_inner(db, env, None, name, policy)\n    --    }\n    --\n    --    pub(super) fn class_member_inner(\n    -+    pub(super) fn class_member_inner_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         specialization: Option<Specialization<'db>>,\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> ClassMemberLookup<'db> {\n    -         // An unspecialized MRO retains mappings such as `Parent[T@Child]`, so ordinary members\n    -         // accessed through `Child` must use its default arguments. Constructor methods are different:\n    -         // we add their class's type variables to the callable's generic context, so those variables\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -                     // Specifically apply the identity specialization; otherwise `iter_mro` will\n    -                     // apply the default specialization for us.\n    -                     let specialization = generic_context.identity_specialization(db);\n    --                    self.class_member_from_mro(\n    -+                    self.class_member_from_mro_with_presence(\n    -                         db,\n    -                         env,\n    -                         name,\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -                     )\n    -                 }\n    -                 _ => {\n    --                    let member =\n    --                        self.class_member_from_mro(db, env, name, policy, self.iter_mro(db, None));\n    -+                    let member = self.class_member_from_mro_with_presence(\n    -+                        db,\n    -+                        env,\n    -+                        name,\n    -+                        policy,\n    -+                        self.iter_mro(db, None),\n    -+                    );\n    -                     let specialization = generic_context.default_specialization(db, self.known(db));\n    -                     // An inherited method's `Self` bound can still contain this class's type\n    -                     // variables, so the default arguments must also specialize that bound.\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -                 }\n    -             }\n    -         } else {\n    --            self.class_member_from_mro(db, env, name, policy, self.iter_mro(db, specialization))\n    -+            self.class_member_from_mro_with_presence(\n    -+                db,\n    -+                env,\n    -+                name,\n    -+                policy,\n    -+                self.iter_mro(db, specialization),\n    -+            )\n    -         }\n    -     }\n    - \n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -         policy: MemberLookupPolicy,\n    -         mro_iter: impl Iterator<Item = ClassBase<'db>>,\n    -     ) -> PlaceAndQualifiers<'db> {\n    -+        self.class_member_from_mro_with_presence(db, env, name, policy, mro_iter)\n    -+            .member\n     +    }\n     +\n    -+    pub(in crate::types) fn class_member_from_mro_with_presence(\n    ++    /// Prove receiver storage from the known part of the MRO. The normal instance lookup\n    ++    /// stops at a dynamic base. Also stop before functional classes can supply synthetic storage.\n    ++    pub(super) fn has_concrete_instance_member(\n     +        self,\n     +        db: &'db dyn Db,\n     +        env: &ProgramEnvironment<'db>,\n     +        name: &str,\n    -+        policy: MemberLookupPolicy,\n    -+        mro_iter: impl Iterator<Item = ClassBase<'db>>,\n    -+    ) -> ClassMemberLookup<'db> {\n    -         fn into_function_like_callable<'d>(\n    -             db: &'d dyn Db,\n    -             env: &ProgramEnvironment<'d>,\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -                 module,\n    -                 policy,\n    -                 name,\n    --            ),\n    -+            )\n    -+            .into(),\n    -         };\n    - \n    -         // We generally treat dunder attributes with `Callable` types as function-like callables.\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -     /// Look up an instance attribute (available in `__dict__`) of the given name.\n    ++    ) -> bool {\n    ++        let Some((class, _)) = self.static_class_literal(db) else {\n    ++            return false;\n    ++        };\n    ++        if class.lacks_instance_storage(db, name) {\n    ++            return false;\n    ++        }\n    ++        let bases = self.iter_mro(db).map(|base| match base {\n    ++            ClassBase::Class(class) if class.static_class_literal(db).is_none() => ClassBase::Any,\n    ++            base => base,\n    ++        });\n    ++        match MroLookup::new(db, env, bases).instance_member(name) {\n    ++            InstanceMemberResult::Done(PlaceAndQualifiers {\n    ++                place:\n    ++                    Place::Defined(DefinedPlace {\n    ++                        ty,\n    ++                        definedness: Definedness::AlwaysDefined,\n    ++                        origin: _,\n    ++                        public_type_policy: _,\n    ++                        provenance: _,\n    ++                    }),\n    ++                qualifiers: _,\n    ++            }) => !ty.is_divergent(),\n    ++            _ => false,\n    ++        }\n    ++    }\n    ++\n    +     /// Returns the inferred type of the class member named `name`. Only bound members\n    +     /// or those marked as `ClassVars` are considered.\n          ///\n    -     /// See [`Type::instance_member`] for more details.\n    --    pub(super) fn instance_member(\n    -+    pub(super) fn instance_member_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         specialization: Option<Specialization<'db>>,\n    -         name: &str,\n    --    ) -> PlaceAndQualifiers<'db> {\n    -+    ) -> ClassMemberLookup<'db> {\n    -         if self.is_typed_dict(db) || self.lacks_instance_storage(db, name) {\n    -             return Place::Undefined.into();\n    -         }\n    -@@ crates/ty_python_semantic/src/types/class/static_literal.rs: impl<'db> StaticClassLiteral<'db> {\n    -                         },\n    -                         TypeContext::default(),\n    -                     )\n    --                }),\n    -+                })\n    -+                .into(),\n    -         }\n    -     }\n    - \n     \n      ## crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs ##\n    -@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: use crate::types::class::FrozenDataclassDispatch;\n    +@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: use crate::types::attribute_write::{\n    +     instance_setattr_dispatch, property_setter_returns_never,\n    + };\n    + use crate::types::call::{Bindings, CallArguments, CallDiagnosticOverride, CallError};\n    +-use crate::types::class::FrozenDataclassDispatch;\n    ++use crate::types::class::{ClassType, FrozenDataclassDispatch};\n      use crate::types::dedicated::pydantic;\n      use crate::types::diagnostic::{\n          DEPRECATED, INVALID_ASSIGNMENT, INVALID_ATTRIBUTE_ACCESS, MISSING_ATTRIBUTE, MISSING_SLOT,\n    @@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: use c\n          report_possibly_missing_attribute,\n      };\n      use crate::types::{\n    +     CallDunderError, DisplaySettings, MemberLookupPolicy, PropertyDeprecations, Type, TypeContext,\n    +-    TypeQualifiers,\n    ++    TypeQualifiers, TypeVarBoundOrConstraints,\n    + };\n    + use crate::{Db, ProgramEnvironment};\n    + \n     @@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> TypeInferenceBuilder<'db, '_> {\n    -         let db = self.db();\n    -         let requirement =\n    -             attribute_write_requirement(db, self.program_environment(), object_ty, attribute, None);\n    --        let mut deprecation = (emit_diagnostics && self.context.is_lint_enabled(&DEPRECATED))\n    --            .then_some(AttributeDeprecation::Missing);\n    -+        let composite = matches!(\n    -+            requirement,\n    -+            AttributeWriteRequirement::All { .. } | AttributeWriteRequirement::Any { .. }\n    -+        );\n    -+        let mut facts = AttributeWriteFacts {\n    -+            definitely_bound: (composite\n    -+                && self.context.is_lint_enabled(&POSSIBLY_MISSING_ATTRIBUTE))\n    -+            .then_some(false),\n    -+            deprecation: (emit_diagnostics && self.context.is_lint_enabled(&DEPRECATED))\n    -+                .then_some(AttributeDeprecation::Missing),\n    -+        };\n    -         let mut evaluator = AssignmentAttributeWriteEvaluator {\n    -             builder: self,\n    -             target,\n                  value,\n                  object_ty,\n                  attribute,\n    -+            possibly_missing: false,\n    ++            requirement: &requirement,\n    ++            definitely_present: None,\n                  infer_value_ty: MultiInferenceGuard::new(infer_value_ty),\n              };\n    --        let valid = evaluator.evaluate(&requirement, emit_diagnostics, deprecation.as_mut());\n    --        if let Some(AttributeDeprecation::Deprecated(properties)) = deprecation {\n    -+        let valid = evaluator.evaluate(&requirement, emit_diagnostics, &mut facts, true);\n    -+        if evaluator.possibly_missing && facts.definitely_bound != Some(true) {\n    -+            report_possibly_missing_attribute(&self.context, target, attribute, object_ty);\n    -+        }\n    -+        if let Some(AttributeDeprecation::Deprecated(properties)) = facts.deprecation {\n    -             self.check_deprecated_property(target, properties, ast::ExprContext::Store);\n    -         }\n    -         valid\n    -@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: enum AttributeDeprecation<'db> {\n    - }\n    - \n    - impl<'db> AttributeDeprecation<'db> {\n    --    /// Inspect a resolved requirement without inferring or validating the assigned value.\n    --    /// Composite requirements need further attribute lookups.\n    --    fn from_requirement(\n    --        db: &'db dyn Db,\n    --        env: &ProgramEnvironment<'db>,\n    --        requirement: &AttributeWriteRequirement<'db>,\n    --        attribute: &str,\n    --    ) -> Self {\n    -+    fn from_leaf(db: &'db dyn Db, requirement: &AttributeWriteRequirement<'db>) -> Self {\n    -         match requirement {\n    --            AttributeWriteRequirement::All {\n    --                element_tys,\n    --                receiver,\n    --                ..\n    --            } => element_tys.iter().fold(Self::Missing, |deprecation, ty| {\n    --                let requirement = attribute_write_requirement(db, env, *ty, attribute, *receiver);\n    --                deprecation.union(db, Self::from_requirement(db, env, &requirement, attribute))\n    --            }),\n    --            AttributeWriteRequirement::Any {\n    --                intersection,\n    --                receiver,\n    --                ..\n    --            } => {\n    --                let mut deprecation = Self::Missing;\n    --                for ty in intersection.positive(db) {\n    --                    let requirement =\n    --                        attribute_write_requirement(db, env, *ty, attribute, *receiver);\n    --                    deprecation = deprecation\n    --                        .intersection(db, Self::from_requirement(db, env, &requirement, attribute));\n    --                    if matches!(deprecation, Self::NotDeprecated) {\n    --                        break;\n    --                    }\n    --                }\n    --                deprecation\n    --            }\n    -             AttributeWriteRequirement::ProtocolMember {\n    -                 write: Some(ProtocolMemberWriteRequirement::Descriptor { descriptor_ty, .. }),\n    -                 ..\n    +         let valid = evaluator.evaluate(&requirement, emit_diagnostics, deprecation.as_mut());\n     @@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> AttributeDeprecation<'db> {\n          }\n      }\n      \n    -+#[derive(Clone, Copy)]\n    -+struct AttributeWriteFacts<'db> {\n    -+    definitely_bound: Option<bool>,\n    -+    deprecation: Option<AttributeDeprecation<'db>>,\n    -+}\n    -+\n    -+impl<'db> AttributeWriteFacts<'db> {\n    -+    fn start_alternatives(&mut self, any: bool) {\n    -+        if let Some(bound) = self.definitely_bound.as_mut() {\n    -+            *bound = !any;\n    ++/// A positive intersection member can establish presence even when another member\n    ++/// governs the write. Only use concrete class declarations and receiver storage as proof.\n    ++fn has_concrete_attribute<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    ty: Type<'db>,\n    ++    attribute: &str,\n    ++) -> bool {\n    ++    let visit = |ty| has_concrete_attribute(db, env, ty, attribute);\n    ++    let as_class = |ty: Type<'db>| -> Option<ClassType<'db>> {\n    ++        match ty {\n    ++            Type::SubclassOf(subclass) => subclass.subclass_of().into_class(db, env),\n    ++            _ => ty.to_class_type(db),\n     +        }\n    -+    }\n    -+\n    -+    fn next_alternative(self, any: bool) -> Self {\n    -+        Self {\n    -+            // OR stops at true, AND at false.\n    -+            definitely_bound: self.definitely_bound.filter(|bound| *bound != any),\n    -+            deprecation: self\n    -+                .deprecation\n    -+                .filter(|deprecation| {\n    -+                    !any || !matches!(deprecation, AttributeDeprecation::NotDeprecated)\n    ++    };\n    ++    match ty {\n    ++        Type::Union(union) => union.elements(db).iter().copied().all(visit),\n    ++        Type::Intersection(intersection) => intersection.positive(db).iter().copied().any(visit),\n    ++        Type::TypeAlias(alias) => visit(alias.value_type(db)),\n    ++        Type::TypeVar(typevar) => match typevar.typevar(db).bound_or_constraints(db, env) {\n    ++            Some(TypeVarBoundOrConstraints::UpperBound(bound)) => bound != ty && visit(bound),\n    ++            Some(TypeVarBoundOrConstraints::Constraints(constraints)) => {\n    ++                constraints.elements(db).iter().copied().all(visit)\n    ++            }\n    ++            None => false,\n    ++        },\n    ++        Type::NominalInstance(instance) => {\n    ++            let class = instance.class(db, env);\n    ++            class.has_concrete_class_member(db, env, attribute, true)\n    ++                || class.has_concrete_instance_member(db, env, attribute)\n    ++        }\n    ++        Type::ClassLiteral(_) | Type::GenericAlias(_) | Type::SubclassOf(_) => {\n    ++            as_class(ty)\n    ++                .is_some_and(|class| class.has_concrete_class_member(db, env, attribute, false))\n    ++                || as_class(ty.to_meta_type(db, env)).is_some_and(|class| {\n    ++                    class.has_concrete_class_member(db, env, attribute, false)\n    ++                        || class.has_concrete_instance_member(db, env, attribute)\n     +                })\n    -+                .map(|_| AttributeDeprecation::Missing),\n    -+        }\n    -+    }\n    -+\n    -+    fn merge(&mut self, db: &'db dyn Db, other: Self, any: bool) {\n    -+        if let (Some(bound), Some(other_bound)) =\n    -+            (&mut self.definitely_bound, other.definitely_bound)\n    -+        {\n    -+            *bound = if any {\n    -+                *bound || other_bound\n    -+            } else {\n    -+                *bound && other_bound\n    -+            };\n    -+        }\n    -+        if let (Some(deprecation), Some(other_deprecation)) =\n    -+            (&mut self.deprecation, other.deprecation)\n    -+        {\n    -+            *deprecation = if any {\n    -+                deprecation.intersection(db, other_deprecation)\n    -+            } else {\n    -+                deprecation.union(db, other_deprecation)\n    -+            };\n    -+        }\n    -+    }\n    -+\n    -+    fn observe_leaf(\n    -+        &mut self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        attribute: &str,\n    -+        requirement: &AttributeWriteRequirement<'db>,\n    -+    ) {\n    -+        if let Some(bound) = self.definitely_bound.as_mut() {\n    -+            *bound = match requirement {\n    -+                AttributeWriteRequirement::Instance {\n    -+                    object_ty,\n    -+                    receiver: _,\n    -+                    member: _,\n    -+                    declared_presence,\n    -+                } => declared_presence.is_declared(db, env, *object_ty, attribute, false),\n    -+                AttributeWriteRequirement::Class {\n    -+                    object_ty,\n    -+                    member: _,\n    -+                    declared_presence,\n    -+                } => declared_presence.is_declared(db, env, *object_ty, attribute, true),\n    -+                AttributeWriteRequirement::ProtocolMember { .. } => true,\n    -+                AttributeWriteRequirement::CannotAssign\n    -+                | AttributeWriteRequirement::Unconstrained\n    -+                | AttributeWriteRequirement::Module(_) => false,\n    -+                AttributeWriteRequirement::All { .. } | AttributeWriteRequirement::Any { .. } => {\n    -+                    unreachable!()\n    -+                }\n    -+            };\n    -+        }\n    -+        if let Some(deprecation) = self.deprecation.as_mut() {\n    -+            *deprecation = AttributeDeprecation::from_leaf(db, requirement);\n    -+        }\n    -+    }\n    -+\n    -+    /// Finish collecting facts after checking the write has short-circuited. This does not\n    -+    /// infer the assigned value or change the context selected by write validation.\n    -+    fn observe_remaining(\n    -+        &mut self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        attribute: &str,\n    -+        remaining: &mut dyn Iterator<Item = AttributeWriteRequirement<'db>>,\n    -+        any: bool,\n    -+    ) {\n    -+        loop {\n    -+            let mut alternative = self.next_alternative(any);\n    -+            if alternative.definitely_bound.is_none() && alternative.deprecation.is_none() {\n    -+                break;\n    -+            }\n    -+            let Some(requirement) = remaining.next() else {\n    -+                break;\n    -+            };\n    -+            match requirement {\n    -+                AttributeWriteRequirement::All {\n    -+                    object_ty: _,\n    -+                    element_tys,\n    -+                    receiver,\n    -+                } => {\n    -+                    alternative.start_alternatives(false);\n    -+                    alternative.observe_remaining(\n    -+                        db,\n    -+                        env,\n    -+                        attribute,\n    -+                        &mut element_tys.iter().map(|ty| {\n    -+                            attribute_write_requirement(db, env, *ty, attribute, receiver)\n    -+                        }),\n    -+                        false,\n    -+                    );\n    -+                }\n    -+                AttributeWriteRequirement::Any {\n    -+                    object_ty: _,\n    -+                    intersection,\n    -+                    receiver,\n    -+                } => {\n    -+                    alternative.start_alternatives(true);\n    -+                    alternative.observe_remaining(\n    -+                        db,\n    -+                        env,\n    -+                        attribute,\n    -+                        &mut intersection.positive(db).iter().map(|ty| {\n    -+                            attribute_write_requirement(db, env, *ty, attribute, receiver)\n    -+                        }),\n    -+                        true,\n    -+                    );\n    -+                }\n    -+                _ => alternative.observe_leaf(db, env, attribute, &requirement),\n    -+            }\n    -+            self.merge(db, alternative, any);\n     +        }\n    ++        _ => false,\n     +    }\n     +}\n     +\n    @@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<\n          value: &'a ast::Expr,\n          object_ty: Type<'db>,\n          attribute: &'a str,\n    -+    possibly_missing: bool,\n    ++    requirement: &'a AttributeWriteRequirement<'db>,\n    ++    definitely_present: Option<bool>,\n          infer_value_ty: MultiInferenceGuard<'db, 'ast, 'infer>,\n      }\n      \n    -@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> AssignmentAttributeWriteEvaluator<'_, 'db, '_, '_> {\n    -         (setattr_result, value_ty)\n    -     }\n    - \n    --    /// Validate the assignment and optionally record its accessor deprecations.\n    --    /// After validation short-circuits, a pure collector inspects the remaining alternatives\n    --    /// without changing the inference context selected for the assigned value.\n    --    /// When provided, `deprecation` receives the result even if validation fails.\n    -     fn evaluate(\n    -         &mut self,\n    -         requirement: &AttributeWriteRequirement<'db>,\n    -         emit_diagnostics: bool,\n    --        mut deprecation: Option<&mut AttributeDeprecation<'db>>,\n    -+        facts: &mut AttributeWriteFacts<'db>,\n    -+        root: bool,\n    -     ) -> bool {\n    -         let db = self.builder.db();\n    -         let env = self.builder.program_environment();\n    --        if let Some(deprecation) = deprecation.as_deref_mut() {\n    --            *deprecation = match requirement {\n    --                AttributeWriteRequirement::All { .. } | AttributeWriteRequirement::Any { .. } => {\n    --                    AttributeDeprecation::Missing\n    --                }\n    --                _ => AttributeDeprecation::from_requirement(db, env, requirement, self.attribute),\n    --            };\n    -+        if !matches!(\n    -+            requirement,\n    -+            AttributeWriteRequirement::All { .. } | AttributeWriteRequirement::Any { .. }\n    -+        ) {\n    -+            facts.observe_leaf(db, env, self.attribute, requirement);\n    -         }\n    - \n    -         match requirement {\n    -@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> AssignmentAttributeWriteEvaluator<'_, 'db, '_, '_> {\n    -                 let mut requirements = element_tys\n    -                     .iter()\n    -                     .map(|ty| attribute_write_requirement(db, env, *ty, attribute, *receiver));\n    -+                facts.start_alternatives(false);\n    -                 let valid = requirements.by_ref().all(|requirement| {\n    --                    let mut current = AttributeDeprecation::Missing;\n    --                    let valid = self.evaluate(\n    --                        &requirement,\n    --                        false,\n    --                        deprecation.as_ref().map(|_| &mut current),\n    --                    );\n    --                    if let Some(deprecation) = deprecation.as_deref_mut() {\n    --                        *deprecation = deprecation.union(db, current);\n    --                    }\n    -+                    let mut alternative = facts.next_alternative(false);\n    -+                    let valid = self.evaluate(&requirement, false, &mut alternative, false);\n    -+                    facts.merge(db, alternative, false);\n    -                     valid\n    -                 });\n    --                if let Some(deprecation) = deprecation {\n    --                    *deprecation = requirements.fold(*deprecation, |deprecation, requirement| {\n    --                        deprecation.union(\n    --                            db,\n    --                            AttributeDeprecation::from_requirement(\n    --                                db,\n    --                                env,\n    --                                &requirement,\n    --                                attribute,\n    --                            ),\n    --                        )\n    --                    });\n    -+                if root && !self.possibly_missing {\n    -+                    facts.definitely_bound = None;\n    -                 }\n    -+                facts.observe_remaining(db, env, attribute, &mut requirements, false);\n    -                 if valid {\n    -                     self.validate_composite_final_assignment(*object_ty, emit_diagnostics);\n    -                 } else if emit_diagnostics {\n    -@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> AssignmentAttributeWriteEvaluator<'_, 'db, '_, '_> {\n    -                     .positive(db)\n    -                     .iter()\n    -                     .map(|ty| attribute_write_requirement(db, env, *ty, attribute, *receiver));\n    -+                facts.start_alternatives(true);\n    -                 let valid = requirements.by_ref().any(|requirement| {\n    --                    let mut current = AttributeDeprecation::Missing;\n    --                    let valid = self.evaluate(\n    --                        &requirement,\n    --                        false,\n    --                        deprecation.as_ref().map(|_| &mut current),\n    --                    );\n    --                    if let Some(deprecation) = deprecation.as_deref_mut() {\n    --                        *deprecation = deprecation.intersection(db, current);\n    --                    }\n    -+                    let mut alternative = facts.next_alternative(true);\n    -+                    let valid = self.evaluate(&requirement, false, &mut alternative, false);\n    -+                    facts.merge(db, alternative, true);\n    -                     valid\n    -                 });\n    --                if let Some(deprecation) = deprecation {\n    --                    while !matches!(deprecation, AttributeDeprecation::NotDeprecated)\n    --                        && let Some(requirement) = requirements.next()\n    --                    {\n    --                        *deprecation = deprecation.intersection(\n    --                            db,\n    --                            AttributeDeprecation::from_requirement(\n    --                                db,\n    --                                env,\n    --                                &requirement,\n    --                                attribute,\n    --                            ),\n    --                        );\n    --                    }\n    -+                if root && !self.possibly_missing {\n    -+                    facts.definitely_bound = None;\n    -                 }\n    -+                facts.observe_remaining(db, env, attribute, &mut requirements, true);\n    -                 if valid {\n    -                     self.infer_with_last_context(emit_diagnostics);\n    -                     self.validate_composite_final_assignment(*object_ty, emit_diagnostics);\n    -@@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> AssignmentAttributeWriteEvaluator<'_, 'db, '_, '_> {\n    -                 object_ty,\n    -                 receiver,\n    -                 member,\n    -+                declared_presence: _,\n    -             } => self.evaluate_instance(*object_ty, *receiver, member, emit_diagnostics),\n    --            AttributeWriteRequirement::Class { object_ty, member } => {\n    --                self.evaluate_class(*object_ty, member, emit_diagnostics)\n    --            }\n    -+            AttributeWriteRequirement::Class {\n    -+                object_ty,\n    -+                member,\n    -+                declared_presence: _,\n    -+            } => self.evaluate_class(*object_ty, member, emit_diagnostics),\n    -         }\n    -     }\n    - \n     @@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<'db> AssignmentAttributeWriteEvaluator<'_, 'db, '_, '_> {\n                      );\n                  }\n    @@ crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs: impl<\n     -                    self.attribute,\n     -                    self.object_ty,\n     -                );\n    -+                self.possibly_missing = true;\n    ++                if self\n    ++                    .builder\n    ++                    .context\n    ++                    .is_lint_enabled(&POSSIBLY_MISSING_ATTRIBUTE)\n    ++                    && !*self\n    ++                        .definitely_present\n    ++                        .get_or_insert_with(|| match self.requirement {\n    ++                            AttributeWriteRequirement::Any {\n    ++                                object_ty: _,\n    ++                                intersection,\n    ++                                receiver: _,\n    ++                            } => intersection\n    ++                                .positive(db)\n    ++                                .iter()\n    ++                                .any(|ty| has_concrete_attribute(db, env, *ty, self.attribute)),\n    ++                            _ => false,\n    ++                        })\n    ++                {\n    ++                    report_possibly_missing_attribute(\n    ++                        &self.builder.context,\n    ++                        self.target,\n    ++                        self.attribute,\n    ++                        self.object_ty,\n    ++                    );\n    ++                }\n                  }\n                  AssignmentAttributeWriteDiagnostic::BadSetAttr { value_ty, failure } => {\n                      failure.report_diagnostics_with_override(\n    -\n    - ## crates/ty_python_semantic/src/types/subclass_of.rs ##\n    -@@\n    - use crate::Db;\n    - use crate::FxOrderSet;\n    --use crate::place::PlaceAndQualifiers;\n    - use crate::types::class::{DynamicClassLiteral, metaclass_instance_type};\n    - use crate::types::constraints::ConstraintSet;\n    - use crate::types::relation::{DisjointnessChecker, TypeRelationChecker, try_constraint};\n    -@@ crates/ty_python_semantic/src/types/subclass_of.rs: impl<'db> SubclassOfType<'db> {\n    -         }\n    -     }\n    - \n    --    pub(crate) fn find_name_in_mro_with_policy(\n    -+    pub(super) fn find_name_in_mro_with_presence(\n    -         self,\n    -         db: &'db dyn Db,\n    -         env: &ProgramEnvironment<'db>,\n    -         name: &str,\n    -         policy: MemberLookupPolicy,\n    --    ) -> Option<PlaceAndQualifiers<'db>> {\n    -+    ) -> Option<super::class::ClassMemberLookup<'db>> {\n    -         if let SubclassOfInner::Protocol(protocol) = self.subclass_of {\n    -             let interface = protocol.interface(db);\n    -             if let Some(member) = interface.meta_member(db, env, name) {\n    --                return Some(member);\n    -+                return Some(member.into());\n    -             }\n    -             if name == \"__hash__\" && interface.includes_member(db, \"__eq__\") {\n    --                return Some(Type::unspecified_protocol_hash(db, env, policy));\n    -+                return Some(Type::unspecified_protocol_hash(db, env, policy).into());\n    -             }\n    -         }\n    - \n    -@@ crates/ty_python_semantic/src/types/subclass_of.rs: impl<'db> SubclassOfType<'db> {\n    -             }\n    -         };\n    - \n    --        class_like.find_name_in_mro_with_policy(db, env, name, policy)\n    -+        class_like.find_name_in_mro_with_presence(db, env, name, policy)\n    -     }\n    - \n    -     pub(super) fn recursive_type_normalized_impl(\n```\n\n[Read the complete warning-only commit](https://github.com/tamird/ruff/commit/4eed4b5f819b499b447ddefa4bb8fbc63cf7853a)."
      },
      "refinement": {
        "before": {
          "head": "fe5dca952cd0512660fde0ce150beb59b48c96bb"
        },
        "after": {
          "head": "4eed4b5f819b499b447ddefa4bb8fbc63cf7853a"
        }
      }
    },
    {
      "id": "branch:typeguard-expansion-targets",
      "type": "branch",
      "repo": "tamird/ruff",
      "title": "[ty] Keep TypeGuard targets stable on expansion",
      "group": "ty",
      "status": "Awaiting Tamir review",
      "ref": "review/typeguard-expansion-targets-20261125",
      "url": "https://github.com/tamird/ruff/commit/f082af91c9131f48c1189ae2c6572b007cce11ae",
      "evidence": [
        {
          "label": "Qualified three-file change",
          "url": "https://github.com/tamird/ruff/commit/f082af91c9131f48c1189ae2c6572b007cce11ae"
        },
        {
          "label": "Failing expansion-order control on upstream",
          "url": "https://app.buildbuddy.io/invocation/0b9c9d9c-14cb-49b7-b248-794dac3b3ba7"
        },
        {
          "label": "Passing regression, full Markdown, native and style checks",
          "url": "https://app.buildbuddy.io/invocation/244f4e63-c790-4675-adb7-73170385ccf4"
        }
      ],
      "head": "f082af91c9131f48c1189ae2c6572b007cce11ae",
      "summary": "Narrow an argument only when every successful expansion and matching overload identifies the same source expression.\n\nCurrent upstream narrows an untested argument for one tuple-union order. The fix passes that case, the reversed and stable controls, all 532 mdtests, native suites, hooks, formatting and strict Clippy.\n\nThis proposal is not approved for upstream submission.",
      "contributorReview": {
        "kind": "proposal",
        "status": "pending",
        "title": "Review qualified ty proposal",
        "summary": "Review the published change and decide whether to submit upstream. Qualification is recorded in the item details. Nothing has been submitted upstream.",
        "head": "f082af91c9131f48c1189ae2c6572b007cce11ae",
        "baseHead": "aacccdff29525ed04398d400f4444a478f15d6aa",
        "url": "https://github.com/tamird/ruff/commit/f082af91c9131f48c1189ae2c6572b007cce11ae"
      }
    },
    {
      "id": "branch:vendored-archive-root",
      "type": "branch",
      "repo": "tamird/ruff",
      "title": "List entries at the root of vendored archives",
      "group": "ty",
      "status": "Awaiting Tamir review",
      "ref": "review/vendored-root-20261125",
      "url": "https://github.com/tamird/ruff/commit/7c83ee2994c4833edc7d0cda06c5a305d9b29aca",
      "evidence": [
        {
          "label": "Qualified one-file root fix",
          "url": "https://github.com/tamird/ruff/commit/7c83ee2994c4833edc7d0cda06c5a305d9b29aca"
        },
        {
          "label": "Failing root-listing control on upstream",
          "url": "https://app.buildbuddy.io/invocation/ead0c18b-e9cc-4036-9745-b2502fb2aa34"
        },
        {
          "label": "Passing Ruff DB suite and style checks",
          "url": "https://app.buildbuddy.io/invocation/b6af58b2-db7e-4efe-8f5c-1a23ed8b94b7"
        },
        {
          "label": "Open archive rewrite touches the same method and retains the bug",
          "url": "https://github.com/astral-sh/ruff/pull/29829"
        }
      ],
      "head": "7c83ee2994c4833edc7d0cda06c5a305d9b29aca",
      "summary": "Keep the prefix empty when listing the archive root so callers can discover top-level entries.\n\nThe root regression fails on current upstream and passes with the fix. Ruff DB has 140 passing tests and one ignored. Canonical hooks, formatting and strict Clippy pass.\n\nThis proposal is not approved for upstream submission.",
      "contributorReview": {
        "kind": "proposal",
        "status": "pending",
        "title": "Review qualified ty proposal",
        "summary": "Review the published change and decide whether to submit upstream. Qualification is recorded in the item details. Nothing has been submitted upstream.",
        "head": "7c83ee2994c4833edc7d0cda06c5a305d9b29aca",
        "baseHead": "aacccdff29525ed04398d400f4444a478f15d6aa",
        "url": "https://github.com/tamird/ruff/commit/7c83ee2994c4833edc7d0cda06c5a305d9b29aca"
      }
    },
    {
      "id": "pr:30897",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 30897,
      "title": "[ty] Group equivalent TypedDict.get keys",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/30897",
      "summary": "The approved amendment adds the literal-union overload filter and exercises the typed empty-dict default.\n\nAll 532 default Markdown fixtures, native suites, formatting and strict Clippy pass on RBE. The many-group debug benchmark takes 627 ms versus 719 ms on the upstream parent.\n\nPublished the approved literal-union fast path and mdtest revision on Ruff #30897.",
      "evidence": [
        {
          "label": "Published amendment",
          "url": "https://github.com/tamird/ruff/commit/abaacc85856e55869b3a772b2e7e4ba509dfbbc2"
        },
        {
          "label": "Amendment RBE qualification",
          "url": "https://app.buildbuddy.io/invocation/9e860df9-a2a4-4c9d-aa1d-ed07264d2d64"
        },
        {
          "label": "Many-group benchmark against upstream parent",
          "url": "https://app.buildbuddy.io/invocation/5d519f3d-7e1d-456d-9ba2-1769db46c593"
        },
        {
          "label": "Four replies to Carl on the published amendment",
          "url": "https://github.com/astral-sh/ruff/pull/30897#pullrequestreview-6078187854"
        },
        {
          "label": "Grouped-key performance and inference review",
          "url": "https://github.com/astral-sh/ruff/pull/30897#pullrequestreview-6044310559"
        },
        {
          "label": "Submitted Ruff PR #30897",
          "url": "https://github.com/astral-sh/ruff/pull/30897"
        },
        {
          "label": "Qualified standalone TypedDict.get grouping commit",
          "url": "https://github.com/tamird/ruff/commit/5d2628cbb2296f33d81828f6ce34a7140a36e5e4"
        },
        {
          "label": "Whole TypedDict, full Markdown and native/style qualification",
          "url": "https://app.buildbuddy.io/invocation/53e62ab8-5901-4039-b69b-650cbdef53e4"
        },
        {
          "label": "Current-base baseline: four intended type assertion failures",
          "url": "https://app.buildbuddy.io/invocation/dfff1183-c060-45f1-ae81-609bfa383ba2"
        },
        {
          "label": "Closed prior literal-call filtering proposal; distinct from signature grouping",
          "url": "https://github.com/astral-sh/ruff/pull/30109"
        },
        {
          "label": "Complementary AST-literal call filtering; does not group signatures or handle union-valued names",
          "url": "https://github.com/astral-sh/ruff/pull/30868"
        }
      ],
      "head": "abaacc85856e55869b3a772b2e7e4ba509dfbbc2",
      "settledReviews": [
        {
          "kind": "proposal",
          "status": "approved",
          "head": "5d2628cbb2296f33d81828f6ce34a7140a36e5e4",
          "baseHead": "3f63e8b368924bb58875a7590e07f667805839a5",
          "url": "https://github.com/tamird/ruff/commit/5d2628cbb2296f33d81828f6ce34a7140a36e5e4",
          "title": "Review equivalent TypedDict.get key grouping",
          "summary": "Tamir approved exact 5d2628cbb for upstream submission; it is submitted as Ruff #30897.",
          "body": "Calls with a union of known keys could match the broad string fallback before argument expansion, losing their field types. With required `first: int` and `second: int` fields, `data.get(key)` should return `int` for `key: Literal[\"first\", \"second\"]`.\n\nThis change groups keys with the same declared value type and requiredness into an exact literal-key overload. Optional groups retain `None` or the supplied default; unions spanning different groups keep their existing fallback behavior.\n\nFour current-base type assertions fail before the change and pass afterward. The whole TypedDict fixture, all 532 default Markdown fixtures, core 86, semantic 539 (35 ignored), IDE 1964, canonical hooks, formatting and strict Clippy pass. No performance claim or network-enabled qualification is made. [Qualification](https://app.buildbuddy.io/invocation/53e62ab8-5901-4039-b69b-650cbdef53e4).\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/5d2628cbb2296f33d81828f6ce34a7140a36e5e4). Tamir approval is required before upstream submission.",
          "outcome": "approved"
        },
        {
          "kind": "amendment",
          "status": "approved",
          "head": "abaacc85856e55869b3a772b2e7e4ba509dfbbc2",
          "baseHead": "5d2628cbb2296f33d81828f6ce34a7140a36e5e4",
          "url": "https://github.com/tamird/ruff/commit/abaacc85856e55869b3a772b2e7e4ba509dfbbc2",
          "title": "TypedDict.get amendment approved",
          "summary": "Tamir approved abaacc8585, now published on Ruff #30897.",
          "outcome": "approved"
        },
        {
          "kind": "amendment",
          "status": "settled",
          "head": "abaacc85856e55869b3a772b2e7e4ba509dfbbc2",
          "baseHead": "5d2628cbb2296f33d81828f6ce34a7140a36e5e4",
          "url": "https://github.com/tamird/ruff/commit/abaacc85856e55869b3a772b2e7e4ba509dfbbc2",
          "title": "Review the TypedDict.get overload amendment",
          "summary": "Published the approved literal-union fast path and mdtest revision on Ruff #30897.",
          "body": "Carl asked about the cost of grouping many small sets of TypedDict keys. This revision defers a declared literal-union overload when every member is disjoint from the actual literal key. If the remaining overloads do not match, the deferred overloads still run for diagnostics.\n\nThe mdtest uses reveal assertions, exercises a contextually typed empty-dict default for optional keys, and records the limitation for reordered unions. Type aliases with different declared identities have the same limitation.\n\nThe debug benchmark with 200 two-key groups took 627 ms versus 719 ms on the upstream parent on the same worker. A separate same-worker run measured 515 ms versus 1.86 s on the published PR. [RBE checks](https://app.buildbuddy.io/invocation/9e860df9-a2a4-4c9d-aa1d-ed07264d2d64) · [Benchmark against upstream](https://app.buildbuddy.io/invocation/5d519f3d-7e1d-456d-9ba2-1769db46c593) · [Carl's review](https://github.com/astral-sh/ruff/pull/30897#pullrequestreview-6044310559)\n\nCaptured with `git range-diff --no-color --no-dual-color --creation-factor=999 5d2628cbb2296f33d81828f6ce34a7140a36e5e4^! abaacc85856e55869b3a772b2e7e4ba509dfbbc2^!`.\n\n```diff\n1:  5d2628cbb2 ! 1:  abaacc8585 [ty] Group equivalent TypedDict.get keys\n    @@ Metadata\n      ## Commit message ##\n         [ty] Group equivalent TypedDict.get keys\n     \n    -    Calls with a union of known keys could match the broad string fallback\n    -    before argument expansion, losing their field types.\n    +    A union of known keys can match the broad string fallback before\n    +    argument expansion, losing the fields' value type. Give keys with the\n    +    same declared type and requiredness a shared literal-key overload.\n    +    Optional groups still accept a default inferred from their value type.\n     \n    -    Group keys with the same declared value type and requiredness into an\n    -    exact literal-key overload. Required and optional groups retain their\n    -    existing default handling. Keys in different groups keep their existing\n    -    fallback behavior.\n    +    A call with a single literal key can set aside an overload if every\n    +    literal in its key union is disjoint from that key. This avoids\n    +    inferring generic defaults for unrelated key groups. If none of the\n    +    remaining overloads matches, check the deferred ones for diagnostics.\n    +\n    +    The debug-profile benchmark with 200 two-key groups took 627 ms\n    +    against its upstream parent's 719 ms on the same BuildBuddy worker.\n    +    In a separate same-worker comparison, the published grouping without\n    +    the literal-union filter took 1.86 s and this revision took 515 ms.\n    +\n    + ## crates/ruff_benchmark/benches/ty.rs ##\n    +@@ crates/ruff_benchmark/benches/ty.rs: fn benchmark_many_protocol_members_mismatch(criterion: &mut Criterion) {\n    +     });\n    + }\n    + \n    ++/// Literal-key groups should skip generic default inference for unrelated keys.\n    ++fn benchmark_typed_dict_get_many_groups(criterion: &mut Criterion) {\n    ++    let mut code =\n    ++        \"from typing import Literal, TypedDict\\n\\nclass Fields(TypedDict, total=False):\\n\"\n    ++            .to_string();\n    ++    for i in 0..200 {\n    ++        writeln!(code, \"    a{i}: Literal[{i}]\\n    b{i}: Literal[{i}]\").ok();\n    ++    }\n    ++    code.push_str(\"\\ndef check(data: Fields):\\n\");\n    ++    for i in 0..200 {\n    ++        writeln!(code, \"    data.get(\\\"a{i}\\\", None)\").ok();\n    ++    }\n    ++    benchmark_micro_case(criterion, \"ty_micro[typed_dict_get_many_groups]\", &code);\n    ++}\n    ++\n    + /// Regression benchmarks for ty#4269: recursive protocol inference and assignment diagnostics.\n    + ///\n    + /// Explicit receiver annotations can repeatedly expand inherited recursive protocol members\n    +@@ crates/ruff_benchmark/benches/ty.rs: criterion_group!(\n    +     benchmark_string_literal_union_comparison,\n    +     benchmark_many_enum_members_2,\n    +     benchmark_many_protocol_members_mismatch,\n    ++    benchmark_typed_dict_get_many_groups,\n    +     benchmark_inherited_recursive_protocol,\n    +     benchmark_nested_generic_constructor_arguments,\n    +     benchmark_nested_recursive_protocol_receiver,\n     \n      ## crates/ty_python_semantic/resources/mdtest/typed_dict.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/typed_dict.md: def _(payload: Payload | Payload2) -> None:\n          takes_resolved(payload.get(\"resolved\", {}))\n      ```\n      \n    -+Equivalent keys retain their common value type when the key is a union of literals. Required and\n    -+non-required fields remain separate because only non-required fields can return the default:\n    ++Keys with identical declared types retain their common value type when the key is a union of\n    ++literals. Required and non-required fields remain separate because only non-required fields can\n    ++return the default:\n     +\n     +```py\n     +from typing import Literal, NotRequired, TypedDict\n    -+from typing_extensions import assert_type\n     +\n     +class Counts(TypedDict):\n     +    first: int\n    @@ crates/ty_python_semantic/resources/mdtest/typed_dict.md: def _(payload: Payload\n     +    optional: Literal[\"optional_first\", \"optional_second\"],\n     +    default: bytes,\n     +) -> None:\n    -+    assert_type(data.get(required), int)\n    -+    assert_type(data.get(required, default), int)\n    -+    assert_type(data.get(optional), int | None)\n    -+    assert_type(data.get(optional, default), int | bytes)\n    ++    reveal_type(data.get(required))  # revealed: int\n    ++    reveal_type(data.get(required, default))  # revealed: int\n    ++    reveal_type(data.get(optional))  # revealed: int | None\n    ++    reveal_type(data.get(optional, default))  # revealed: int | bytes\n    ++```\n    ++\n    ++The field type also provides context for an empty dictionary default with a union of optional keys:\n    ++\n    ++```py\n    ++class ResolvedPayload(TypedDict, total=False):\n    ++    first: ResolvedData\n    ++    second: ResolvedData\n    ++\n    ++def _(data: ResolvedPayload, key: Literal[\"first\", \"second\"]):\n    ++    reveal_type(data.get(key, {}))  # revealed: ResolvedData\n    ++```\n    ++\n    ++Grouping currently uses type identity rather than equivalence. TODO: Reordered unions and aliases\n    ++for the same type do not share an overload:\n    ++\n    ++```py\n    ++class ReorderedFields(TypedDict):\n    ++    first: int | str\n    ++    second: str | int\n    ++\n    ++def _(data: ReorderedFields, key: Literal[\"first\", \"second\"]):\n    ++    reveal_type(data.get(key))  # revealed: Unknown | None\n     +```\n     +\n      Nested calls can infer different defaults even when the overloads for different keys share a\n      synthetic type variable.\n      \n     \n    + ## crates/ty_python_semantic/src/types/call/bind.rs ##\n    +@@ crates/ty_python_semantic/src/types/call/bind.rs: impl<'db> Binding<'db> {\n    +                     return false;\n    +                 }\n    +                 let declared = parameter.annotated_type();\n    +-                let Some(expected) = declared.as_literal_value() else {\n    +-                    return false;\n    +-                };\n    +-                argument\n    ++                let Some(actual) = argument\n    +                     .matched_type(declared, matched.argument_type)\n    +                     .and_then(Type::as_literal_value)\n    +-                    .is_some_and(|actual| actual.is_disjoint_from(db, expected))\n    ++                else {\n    ++                    return false;\n    ++                };\n    ++                match declared {\n    ++                    Type::LiteralValue(expected) => actual.is_disjoint_from(db, expected),\n    ++                    Type::Union(union) => union.elements(db).iter().all(|element| {\n    ++                        element\n    ++                            .as_literal_value()\n    ++                            .is_some_and(|expected| actual.is_disjoint_from(db, expected))\n    ++                    }),\n    ++                    _ => false,\n    ++                }\n    +             })\n    +     }\n    + \n    +\n      ## crates/ty_python_semantic/src/types/class/typed_dict.rs ##\n     @@ crates/ty_python_semantic/src/types/class/typed_dict.rs: use crate::types::class::{\n      use crate::types::generics::GenericContext;\n```",
          "outcome": "posted",
          "postedAt": "2026-11-25T18:02:54+00:00",
          "postedURL": "https://github.com/astral-sh/ruff/pull/30897"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "abaacc85856e55869b3a772b2e7e4ba509dfbbc2",
        "nextAction": "Four replies are posted on abaacc858. All four threads remain open. Re-request Carl’s review."
      }
    },
    {
      "id": "pr:30898",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 30898,
      "title": "[ty] Honor NotImplemented in binary operators",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/30898",
      "summary": "Approved 88b15ebe is published. Hosted CodSpeed flags simple_script; eight alternating matched RBE rounds did not reproduce the slowdown (27.63 to 27.52 ms median round averages).\n\nNative suites, all 532 Markdown tests, canonical hooks, formatting and strict Clippy pass on 88b15ebe. Both regression fixtures fail on published 0af5b7f2e.\n\nApproved 88b15ebe is published on PR #30898; current GitHub checks are recorded separately.",
      "evidence": [
        {
          "label": "Late CodSpeed performance report: simple_script regression",
          "url": "https://github.com/astral-sh/ruff/pull/30898#issuecomment-7163169790"
        },
        {
          "label": "Matched simple_script timings on the hosted comparison trees",
          "url": "https://app.buildbuddy.io/invocation/c8e573ee-79ed-40d3-8bda-3dbaf9b7d906"
        },
        {
          "label": "Qualified arithmetic amendment 88b15ebe",
          "url": "https://github.com/tamird/ruff/commit/88b15ebe27958d0cdac952904b9f4d497c0a0d18"
        },
        {
          "label": "Native suites, full Markdown and strict style qualification",
          "url": "https://app.buildbuddy.io/invocation/f6a9e652-fe1f-4866-b3f2-251ac7fa181d"
        },
        {
          "label": "Published 0af regression controls",
          "url": "https://app.buildbuddy.io/invocation/dd07a677-6774-4678-89c6-55ccc1bb30fb"
        },
        {
          "label": "Alex: ordinary dunders and annotation conventions",
          "url": "https://github.com/astral-sh/ruff/pull/30898#issuecomment-7136569495"
        }
      ],
      "head": "88b15ebe27958d0cdac952904b9f4d497c0a0d18",
      "settledReviews": [
        {
          "kind": "proposal",
          "status": "approved",
          "head": "0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9",
          "baseHead": "3f63e8b368924bb58875a7590e07f667805839a5",
          "url": "https://github.com/tamird/ruff/commit/0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9",
          "title": "Review in-place NotImplemented fallback",
          "summary": "Tamir approved exact 0af5b7f2e for upstream submission; it is submitted as Ruff #30898.",
          "body": "An in-place method can return `NotImplemented` to request the ordinary binary operation. The sentinel was instead assigned to the target, bypassing ordinary and reflected dispatch and missing unsupported-operand errors.\n\nThis change removes sentinel alternatives and uses the existing binary dispatch for them. Other return alternatives and the fallback for conditionally defined in-place methods remain.\n\nThe exact current-base regression fails before the change and passes afterward. The whole augmented-assignment fixture, all 532 default Markdown fixtures, core 86, semantic 539 (35 ignored), IDE 1964, canonical hooks, formatting and strict Clippy pass. Network-enabled modes were not separately qualified. [Qualification](https://app.buildbuddy.io/invocation/e19deaea-67f1-41bf-95bf-ac212d18d525).\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9). Tamir approval is required before upstream submission.",
          "outcome": "approved"
        },
        {
          "kind": "amendment",
          "status": "approved",
          "head": "88b15ebe27958d0cdac952904b9f4d497c0a0d18",
          "baseHead": "0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9",
          "url": "https://github.com/tamird/ruff/commit/88b15ebe27958d0cdac952904b9f4d497c0a0d18",
          "title": "Review the arithmetic amendment for PR #30898",
          "summary": "Tamir approved exact 88b15ebe for the PR #30898 update.",
          "body": "Review the replacement for Ruff #30898: published `0af5b7f2e` → proposed `88b15ebe27`. Both commits use upstream `3f63e8b36` as their base.\n\nThe revision handles `NotImplemented` in ordinary and reflected arithmetic as well as augmented assignments. Existing successful-result annotations and parameter-based fallback remain supported. Direct method calls retain their original return types. Callability errors block reflection; methods on two operands with the same known runtime class are not retried as reflected calls.\n\nThe original two regression fixtures fail on published `0af5b7f2e`. The candidate passes core 86, semantic 539 (35 ignored), IDE 1,964, all 532 default Markdown tests, canonical hooks, formatting and strict Clippy. [Qualification](https://app.buildbuddy.io/invocation/f6a9e652-fe1f-4866-b3f2-251ac7fa181d); [published-head controls](https://app.buildbuddy.io/invocation/dd07a677-6774-4678-89c6-55ccc1bb30fb).\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/88b15ebe27958d0cdac952904b9f4d497c0a0d18).\n\n## Changes from the submitted commit\n\nThis is Git's actual paired range-diff of the two single-commit proposals.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 3f63e8b368924bb58875a7590e07f667805839a5..0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9 3f63e8b368924bb58875a7590e07f667805839a5..88b15ebe27958d0cdac952904b9f4d497c0a0d18\n```\n\n```diff\n1:  0af5b7f2e0 ! 1:  88b15ebe27 [ty] Honor NotImplemented in augmented assignments\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Honor NotImplemented in augmented assignments\n    +    [ty] Honor NotImplemented in binary operators\n     \n    -    An in-place method can return NotImplemented to request the ordinary\n    -    binary operation. That result was instead assigned to the target,\n    -    bypassing ordinary and reflected dispatch and missing unsupported-operand\n    -    errors.\n    +    Binary dispatch stopped when a method returned NotImplemented, so\n    +    arithmetic could infer the sentinel instead of trying a reflected method\n    +    or reporting an unsupported operation. The in-place fallback could\n    +    expose the same result after __iadd__ declined.\n     \n    -    Remove the sentinel alternatives and use the existing binary dispatch for\n    -    them. Retain other return alternatives and the fallback for conditionally\n    -    defined in-place methods.\n    +    Treat NotImplemented as a request to continue dispatch, preserving other\n    +    return alternatives when fallback succeeds. Conditionally defined\n    +    methods also retain their own return types alongside the fallback. Reuse\n    +    this partition for in-place results. Keep original call bindings for\n    +    navigation and retain deprecation warnings from methods that decline the\n    +    operation.\n    +\n    +    Distinguish unavailable methods from methods that may not be callable;\n    +    the latter can raise before reflection. Suppress reflected calls when\n    +    both operands have the same exact runtime class [1]. This includes\n    +    different specializations of a final generic class.\n    +\n    +    Conventional successful-result annotations and parameter-based fallback\n    +    remain supported; direct method calls keep their annotated or inferred\n    +    return types. This does not change the annotation validation discussed\n    +    in [2].\n    +\n    +    [1]: https://docs.python.org/3/reference/datamodel.html#object.__radd__\n    +    [2]: https://github.com/astral-sh/ty/issues/1150\n     \n      ## crates/ty_python_semantic/resources/mdtest/assignment/augmented.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/assignment/augmented.md: x += \"Hello\"\n    @@ crates/ty_python_semantic/resources/mdtest/assignment/augmented.md: x += \"Hello\"\n     +Returning `NotImplemented` requests ordinary binary dispatch, including the reflected method. The\n     +sentinel is never assigned to the target; other in-place return alternatives are retained.\n     +\n    ++```toml\n    ++[analysis]\n    ++return-type-inference = \"always\"\n    ++```\n    ++\n     +```py\n     +from types import NotImplementedType\n    ++from typing import final\n     +\n     +InPlaceResult = int | NotImplementedType\n     +\n    ++@final\n     +class Left:\n    -+    def __iadd__(self, other: object) -> NotImplementedType:\n    ++    def __iadd__(self, other: object):\n     +        return NotImplemented\n     +\n     +    def __add__(self, other: int) -> str:\n     +        return \"added\"\n     +\n     +class Right:\n    -+    def __radd__(self, other: Left) -> bytes:\n    ++    def __radd__(self, other: object) -> bytes:\n     +        return b\"reflected\"\n     +\n     +left = Left()\n    @@ crates/ty_python_semantic/resources/mdtest/assignment/augmented.md: x += \"Hello\"\n     +mixed = Mixed()\n     +mixed += 1\n     +reveal_type(mixed)  # revealed: int | str\n    ++\n    ++@final\n    ++class Declines:\n    ++    def __iadd__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++    def __add__(self, other: object):\n    ++        return NotImplemented\n    ++\n    ++both = Declines()\n    ++both += Right()\n    ++reveal_type(both)  # revealed: bytes\n     +```\n     +\n      ## Unsupported types\n      \n      ```py\n     \n    + ## crates/ty_python_semantic/resources/mdtest/binary/instances.md ##\n    +@@ crates/ty_python_semantic/resources/mdtest/binary/instances.md: class GenericChild(GenericBase[T]):\n    + def add_generic(left: GenericBase[int], right: GenericChild[str]) -> Literal[\"left\", \"right\"]:\n    +     reveal_type(left + right)  # revealed: Literal[\"right\", \"left\"]\n    +     return left + right\n    ++\n    ++from types import NotImplementedType\n    ++from typing import final\n    ++\n    ++@final\n    ++class Box(Generic[T]):\n    ++    value: T\n    ++\n    ++    def __add__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++    def __radd__(self, other: object) -> int:\n    ++        return 1\n    ++\n    ++def same_runtime_class(left: Box[int], right: Box[str]):\n    ++    # error: [unsupported-operator]\n    ++    reveal_type(left + right)  # revealed: Unknown\n    + ```\n    + \n    + ## Class objects use their metaclasses for reflected precedence\n    +@@ crates/ty_python_semantic/resources/mdtest/binary/instances.md: class B:\n    + reveal_type(A() - B())  # revealed: B\n    + ```\n    + \n    ++## Methods returning `NotImplemented`\n    ++\n    ++An explicit or inferred `NotImplemented` return tries the next method. Direct calls retain the\n    ++method's return type:\n    ++\n    ++```toml\n    ++[analysis]\n    ++return-type-inference = \"always\"\n    ++```\n    ++\n    ++```py\n    ++from types import NotImplementedType\n    ++from typing import final\n    ++\n    ++class Reflected:\n    ++    def __radd__(self, other: object) -> int:\n    ++        return 1\n    ++\n    ++@final\n    ++class Inferred:\n    ++    def __add__(self, other: object):\n    ++        if isinstance(other, bytes):\n    ++            return other\n    ++        return NotImplemented\n    ++\n    ++reveal_type(Inferred().__add__(Reflected()))  # revealed: bytes | NotImplementedType\n    ++reveal_type(Inferred() + Reflected())  # revealed: bytes | int\n    ++\n    ++# error: [unsupported-operator]\n    ++reveal_type(Inferred() + object())  # revealed: Unknown\n    ++\n    ++class Declines:\n    ++    def __add__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++    def __radd__(self, other: object) -> int:\n    ++        return 1\n    ++\n    ++reveal_type(Declines() + Reflected())  # revealed: int\n    ++\n    ++# Reflected methods are not tried for two operands of the same runtime type.\n    ++# error: [unsupported-operator]\n    ++reveal_type(Declines() + Declines())  # revealed: Unknown\n    ++\n    ++class Refuses:\n    ++    def __radd__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++# error: [unsupported-operator]\n    ++reveal_type(Declines() + Refuses())  # revealed: Unknown\n    ++\n    ++class Blocked:\n    ++    __add__ = None\n    ++\n    ++# A non-callable method raises instead of trying the reflected method.\n    ++# error: [unsupported-operator]\n    ++reveal_type(Blocked() + Reflected())  # revealed: Unknown\n    ++```\n    ++\n    + ## Callable instances as dunders\n    + \n    + Believe it or not, this is supported at runtime:\n    +\n    + ## crates/ty_python_semantic/src/types/call.rs ##\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> OperatorResult<'db> {\n    +         db: &'db dyn Db,\n    +         env: &ProgramEnvironment<'db>,\n    +         bindings: &Bindings<'db>,\n    ++    ) -> Self {\n    ++        Self::from_bindings_and_return_type(db, bindings, bindings.return_type(db, env))\n    ++    }\n    ++\n    ++    fn from_bindings_and_return_type(\n    ++        db: &'db dyn Db,\n    ++        bindings: &Bindings<'db>,\n    ++        return_type: Type<'db>,\n    +     ) -> Self {\n    +         Self {\n    +-            return_type: bindings.return_type(db, env),\n    ++            return_type,\n    +             deprecated_functions: bindings\n    +                 .deprecated_functions(db)\n    +                 .map(|(_, function)| function)\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> OperatorResult<'db> {\n    +     }\n    + }\n    + \n    ++/// The methods called by a binary operation and its result after `NotImplemented` fallback.\n    ++///\n    ++/// Method bindings retain their original return types for IDE navigation. Arithmetic syntax\n    ++/// uses a separate result after `NotImplemented` fallback.\n    ++pub(crate) struct BinaryOperatorCall<'db> {\n    ++    pub(super) bindings: Bindings<'db>,\n    ++    pub(super) return_type: Type<'db>,\n    ++}\n    ++\n    ++impl<'db> BinaryOperatorCall<'db> {\n    ++    fn union(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, other: Self) -> Self {\n    ++        let Self {\n    ++            bindings: left,\n    ++            return_type: left_type,\n    ++        } = self;\n    ++        let Self {\n    ++            bindings: right,\n    ++            return_type: right_type,\n    ++        } = other;\n    ++        let callable_type =\n    ++            UnionType::from_two_elements(db, env, left.callable_type(), right.callable_type());\n    ++        Self {\n    ++            bindings: Bindings::from_union(callable_type, [left, right]),\n    ++            return_type: UnionType::from_two_elements(db, env, left_type, right_type),\n    ++        }\n    ++    }\n    ++\n    ++    pub(super) fn into_result(self, db: &'db dyn Db) -> OperatorResult<'db> {\n    ++        let Self {\n    ++            bindings,\n    ++            return_type,\n    ++        } = self;\n    ++        OperatorResult::from_bindings_and_return_type(db, &bindings, return_type)\n    ++    }\n    ++}\n    ++\n    ++#[expect(\n    ++    clippy::large_enum_variant,\n    ++    reason = \"Boxing adds an allocation to each successful call\"\n    ++)]\n    ++enum OperatorCallOutcome<'db> {\n    ++    Called {\n    ++        call: BinaryOperatorCall<'db>,\n    ++        /// The method can return `NotImplemented` or may not be defined at runtime.\n    ++        may_fall_through: bool,\n    ++    },\n    ++    Unavailable,\n    ++    Blocked,\n    ++}\n    ++\n    ++impl<'db> OperatorCallOutcome<'db> {\n    ++    fn into_error(self, db: &'db dyn Db) -> CallBinOpError<'db> {\n    ++        match self {\n    ++            Self::Called {\n    ++                call,\n    ++                may_fall_through: _,\n    ++            } => CallBinOpError::from_call(db, call),\n    ++            Self::Unavailable => CallBinOpError::default(),\n    ++            Self::Blocked => CallBinOpError::default(),\n    ++        }\n    ++    }\n    ++}\n    ++\n    ++fn operator_call_outcome<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    call: Result<Bindings<'db>, CallDunderError<'db>>,\n    ++) -> OperatorCallOutcome<'db> {\n    ++    let (bindings, possibly_unbound) = match call {\n    ++        Ok(bindings) => (bindings, false),\n    ++        Err(error) => match error {\n    ++            CallDunderError::PossiblyUnbound {\n    ++                bindings,\n    ++                unbound_on: _,\n    ++            } => (*bindings, true),\n    ++            CallDunderError::MethodNotAvailable => return OperatorCallOutcome::Unavailable,\n    ++            CallDunderError::CallError(kind, _, _) => match kind {\n    ++                // Calling a non-callable method can raise before reflection, even if other\n    ++                // possible method types are callable.\n    ++                CallErrorKind::NotCallable => return OperatorCallOutcome::Blocked,\n    ++                CallErrorKind::PossiblyNotCallable => return OperatorCallOutcome::Blocked,\n    ++                // Keep parameter-based fallback for the existing annotation convention.\n    ++                CallErrorKind::BindingError => return OperatorCallOutcome::Unavailable,\n    ++            },\n    ++        },\n    ++    };\n    ++    let (return_type, may_decline) = bindings.return_type(db, env).split_not_implemented(db, env);\n    ++    OperatorCallOutcome::Called {\n    ++        call: BinaryOperatorCall {\n    ++            bindings,\n    ++            return_type,\n    ++        },\n    ++        may_fall_through: may_decline || possibly_unbound,\n    ++    }\n    ++}\n    ++\n    ++fn resolve_ordered_operator_calls<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    first: OperatorCallOutcome<'db>,\n    ++    fallback: impl FnOnce() -> OperatorCallOutcome<'db>,\n    ++) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    ++    let first = match first {\n    ++        OperatorCallOutcome::Called {\n    ++            call,\n    ++            may_fall_through,\n    ++        } => {\n    ++            if !may_fall_through {\n    ++                return Ok(call);\n    ++            }\n    ++            Some(call)\n    ++        }\n    ++        OperatorCallOutcome::Unavailable => None,\n    ++        OperatorCallOutcome::Blocked => return Err(CallBinOpError::default()),\n    ++    };\n    ++    match fallback() {\n    ++        OperatorCallOutcome::Called {\n    ++            call: second,\n    ++            may_fall_through,\n    ++        } => {\n    ++            let call = match first {\n    ++                Some(first) => first.union(db, env, second),\n    ++                None => second,\n    ++            };\n    ++            if may_fall_through {\n    ++                Err(CallBinOpError::from_call(db, call))\n    ++            } else {\n    ++                Ok(call)\n    ++            }\n    ++        }\n    ++        OperatorCallOutcome::Unavailable => Err(match first {\n    ++            Some(call) => CallBinOpError::from_call(db, call),\n    ++            None => CallBinOpError::default(),\n    ++        }),\n    ++        OperatorCallOutcome::Blocked => Err(match first {\n    ++            Some(call) => CallBinOpError::from_call(db, call),\n    ++            None => CallBinOpError::default(),\n    ++        }),\n    ++    }\n    ++}\n    ++\n    ++fn resolve_possible_operator_calls<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    first: OperatorCallOutcome<'db>,\n    ++    second: OperatorCallOutcome<'db>,\n    ++) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    ++    let (call, may_fall_through) = match first {\n    ++        OperatorCallOutcome::Blocked => return Err(second.into_error(db)),\n    ++        OperatorCallOutcome::Unavailable => match second {\n    ++            OperatorCallOutcome::Called {\n    ++                call,\n    ++                may_fall_through,\n    ++            } => (call, may_fall_through),\n    ++            OperatorCallOutcome::Unavailable => return Err(CallBinOpError::default()),\n    ++            OperatorCallOutcome::Blocked => return Err(CallBinOpError::default()),\n    ++        },\n    ++        OperatorCallOutcome::Called {\n    ++            call: first,\n    ++            may_fall_through: first_declines,\n    ++        } => match second {\n    ++            OperatorCallOutcome::Called {\n    ++                call: second,\n    ++                may_fall_through: second_declines,\n    ++            } => (\n    ++                first.union(db, env, second),\n    ++                first_declines && second_declines,\n    ++            ),\n    ++            OperatorCallOutcome::Unavailable => (first, first_declines),\n    ++            OperatorCallOutcome::Blocked => return Err(CallBinOpError::from_call(db, first)),\n    ++        },\n    ++    };\n    ++    if may_fall_through {\n    ++        Err(CallBinOpError::from_call(db, call))\n    ++    } else {\n    ++        Ok(call)\n    ++    }\n    ++}\n    ++\n    + /// Whether the right operand's reflected method has priority based on the possible runtime\n    + /// classes of both operands.\n    + ///\n    +@@ crates/ty_python_semantic/src/types/call.rs: fn reflected_method_priority<'db>(\n    + }\n    + \n    + impl<'db> Type<'db> {\n    ++    /// Separate operator result values from a request to try another method.\n    ++    pub(super) fn split_not_implemented(\n    ++        self,\n    ++        db: &'db dyn Db,\n    ++        env: &ProgramEnvironment<'db>,\n    ++    ) -> (Self, bool) {\n    ++        let expanded = self.expand_top_level_aliases(db, env);\n    ++        let completing = match expanded {\n    ++            Type::Union(union) => union.filter(db, |ty| !ty.is_notimplemented(db)),\n    ++            ty => {\n    ++                if ty.is_notimplemented(db) {\n    ++                    Type::Never\n    ++                } else {\n    ++                    ty\n    ++                }\n    ++            }\n    ++        };\n    ++        if completing == expanded {\n    ++            (self, false)\n    ++        } else {\n    ++            (completing, true)\n    ++        }\n    ++    }\n    ++\n    +     /// Return the result of dispatching a rich comparison method between two operands.\n    +     ///\n    +     /// A strict subclass on the right takes precedence over the normal method on the left.\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> Type<'db> {\n    + \n    +     /// Memoize the return type and deprecations from binary dunder resolution, without retaining\n    +     /// the full call bindings or repeating overload selection at each expression.\n    +-    /// Returns `None` if resolution fails; callers remain responsible for call-site diagnostics.\n    ++    /// Failed resolution retains called-method metadata;\n    ++    /// callers remain responsible for call-site diagnostics.\n    +     pub(crate) fn try_call_bin_op_result(\n    +         db: &'db dyn Db,\n    +         env: &ProgramEnvironment<'db>,\n    +         left_ty: Type<'db>,\n    +         op: ast::Operator,\n    +         right_ty: Type<'db>,\n    +-    ) -> Option<&'db OperatorResult<'db>> {\n    +-        #[salsa::tracked(returns(ref), cycle_initial=|_, _, _, _, _, _, _| None, heap_size=ruff_memory_usage::heap_size)]\n    ++    ) -> Result<&'db OperatorResult<'db>, &'db CallBinOpError<'db>> {\n    ++        #[salsa::tracked(returns(ref), cycle_initial=|_, _, _, _, _, _, _| Err(CallBinOpError::default()), heap_size=ruff_memory_usage::heap_size)]\n    +         fn try_call_bin_op_result_impl<'db>(\n    +             db: &'db dyn Db,\n    +             program: Program<'db>,\n    +             left_ty: Type<'db>,\n    +             op: ast::Operator,\n    +             right_ty: Type<'db>,\n    +-        ) -> Option<OperatorResult<'db>> {\n    ++        ) -> Result<OperatorResult<'db>, CallBinOpError<'db>> {\n    +             let env = &ProgramEnvironment::from_program(program);\n    +-            Type::try_call_bin_op(db, env, left_ty, op, right_ty)\n    +-                .ok()\n    +-                .map(|bindings| OperatorResult::from_bindings(db, env, &bindings))\n    ++            Type::try_call_bin_op(db, env, left_ty, op, right_ty).map(|call| call.into_result(db))\n    +         }\n    + \n    +         try_call_bin_op_result_impl(db, env.program(db), left_ty, op, right_ty).as_ref()\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> Type<'db> {\n    +         left_ty: Type<'db>,\n    +         op: ast::Operator,\n    +         right_ty: Type<'db>,\n    +-    ) -> Result<Bindings<'db>, CallBinOpError> {\n    ++    ) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    +         Self::try_call_bin_op_with_policy(\n    +             db,\n    +             env,\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> Type<'db> {\n    +         op: ast::Operator,\n    +         right_ty: Type<'db>,\n    +         policy: MemberLookupPolicy,\n    +-    ) -> Result<Bindings<'db>, CallBinOpError> {\n    +-        // We either want to call lhs.__op__ or rhs.__rop__. The full decision tree from\n    +-        // the Python spec [1] is:\n    +-        //\n    +-        //   - If rhs is a (proper) subclass of lhs, and it provides a different\n    +-        //     implementation of __rop__, use that.\n    +-        //   - Otherwise, if lhs implements __op__, use that.\n    +-        //   - Otherwise, if lhs and rhs are different types, and rhs implements __rop__,\n    +-        //     use that.\n    +-        //\n    +-        // [1] https://docs.python.org/3/reference/datamodel.html#object.__radd__\n    +-\n    +-        // Runtime classes determine reflected priority, but static operand types may only\n    +-        // establish that priority conditionally.\n    ++    ) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    ++        // A different reflected implementation on a proper subclass is tried first.\n    ++        // A method that returns NotImplemented lets the next method run; parameter\n    ++        // binding failures retain their existing fallback behavior.\n    ++        let call_dunder = |receiver: Type<'db>, argument: Type<'db>, name| {\n    ++            operator_call_outcome(\n    ++                db,\n    ++                env,\n    ++                receiver.try_call_dunder_with_policy(\n    ++                    db,\n    ++                    env,\n    ++                    name,\n    ++                    &mut CallArguments::positional([argument]),\n    ++                    TypeContext::default(),\n    ++                    policy,\n    ++                ),\n    ++            )\n    ++        };\n    ++        let call_left = || call_dunder(left_ty, right_ty, op.dunder());\n    ++        let call_right = || {\n    ++            if left_ty == right_ty {\n    ++                return OperatorCallOutcome::Unavailable;\n    ++            }\n    ++            // Different specializations can still have the same exact runtime class.\n    ++            let same_runtime_class = has_exact_runtime_class(db, env, left_ty)\n    ++                && has_exact_runtime_class(db, env, right_ty)\n    ++                && operator_dispatch_class(db, env, left_ty)\n    ++                    .zip(operator_dispatch_class(db, env, right_ty))\n    ++                    .is_some_and(|(left, right)| left.class_literal(db) == right.class_literal(db));\n    ++            if same_runtime_class {\n    ++                OperatorCallOutcome::Unavailable\n    ++            } else {\n    ++                call_dunder(right_ty, left_ty, op.reflected_dunder())\n    ++            }\n    ++        };\n    +         let reflected_priority = reflected_method_priority(db, env, left_ty, right_ty);\n    +-\n    +-        let left_class = left_ty.to_meta_type(db, env);\n    +-        let right_class = right_ty.to_meta_type(db, env);\n    +         if reflected_priority != ReflectedMethodPriority::Never {\n    +             let reflected_dunder = op.reflected_dunder();\n    ++            let left_class = left_ty.to_meta_type(db, env);\n    ++            let right_class = right_ty.to_meta_type(db, env);\n    +             let rhs_reflected = right_class.member(db, env, reflected_dunder).place;\n    +-            // TODO: if `rhs_reflected` is possibly unbound, we should union the two possible\n    +-            // Bindings together\n    +             if !rhs_reflected.is_undefined()\n    +                 && !rhs_reflected.is_equal_ignoring_provenance(\n    +                     left_class.member(db, env, reflected_dunder).place,\n    +                 )\n    +             {\n    +-                let call_on_right_instance = right_ty.try_call_dunder_with_policy(\n    +-                    db,\n    +-                    env,\n    +-                    reflected_dunder,\n    +-                    &mut CallArguments::positional([left_ty]),\n    +-                    TypeContext::default(),\n    +-                    policy,\n    +-                );\n    +-\n    +                 if reflected_priority == ReflectedMethodPriority::Definitely {\n    +-                    return Ok(call_on_right_instance.or_else(|_| {\n    +-                        left_ty.try_call_dunder_with_policy(\n    +-                            db,\n    +-                            env,\n    +-                            op.dunder(),\n    +-                            &mut CallArguments::positional([right_ty]),\n    +-                            TypeContext::default(),\n    +-                            policy,\n    +-                        )\n    +-                    })?);\n    ++                    return resolve_ordered_operator_calls(db, env, call_right(), call_left);\n    +                 }\n    +-\n    +-                let call_on_left_instance = left_ty.try_call_dunder_with_policy(\n    +-                    db,\n    +-                    env,\n    +-                    op.dunder(),\n    +-                    &mut CallArguments::positional([right_ty]),\n    +-                    TypeContext::default(),\n    +-                    policy,\n    +-                );\n    +-\n    +-                return match (call_on_right_instance, call_on_left_instance) {\n    +-                    (Ok(right_bindings), Ok(left_bindings)) => {\n    +-                        let callable_type = UnionType::from_two_elements(\n    +-                            db,\n    +-                            env,\n    +-                            right_bindings.callable_type(),\n    +-                            left_bindings.callable_type(),\n    +-                        );\n    +-                        Ok(Bindings::from_union(\n    +-                            callable_type,\n    +-                            [right_bindings, left_bindings],\n    +-                        ))\n    +-                    }\n    +-                    (Ok(bindings), Err(_)) | (Err(_), Ok(bindings)) => Ok(bindings),\n    +-                    (Err(_), Err(error)) => Err(error.into()),\n    +-                };\n    ++                // Either method may have runtime priority. Both are evaluated once; if\n    ++                // either always completes, neither ordering can exhaust both methods.\n    ++                return resolve_possible_operator_calls(db, env, call_right(), call_left());\n    +             }\n    +         }\n    +-\n    +-        let call_on_left_instance = left_ty.try_call_dunder_with_policy(\n    +-            db,\n    +-            env,\n    +-            op.dunder(),\n    +-            &mut CallArguments::positional([right_ty]),\n    +-            TypeContext::default(),\n    +-            policy,\n    +-        );\n    +-\n    +-        call_on_left_instance.or_else(|_| {\n    +-            if left_ty == right_ty {\n    +-                Err(CallBinOpError::NotSupported)\n    +-            } else {\n    +-                Ok(right_ty.try_call_dunder_with_policy(\n    +-                    db,\n    +-                    env,\n    +-                    op.reflected_dunder(),\n    +-                    &mut CallArguments::positional([left_ty]),\n    +-                    TypeContext::default(),\n    +-                    policy,\n    +-                )?)\n    +-            }\n    +-        })\n    ++        resolve_ordered_operator_calls(db, env, call_left(), call_right)\n    +     }\n    + }\n    + \n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> CallDunderError<'db> {\n    +     }\n    + }\n    + \n    +-#[derive(Debug)]\n    +-pub(crate) enum CallBinOpError {\n    +-    /// The dunder attribute exists but it can't be called with the given arguments.\n    +-    ///\n    +-    /// This includes non-callable dunder attributes that are possibly unbound.\n    +-    CallError,\n    +-\n    +-    NotSupported,\n    ++/// Called-method metadata retained when a binary operation is unsupported.\n    ++#[derive(Clone, Debug, Default, PartialEq, Eq, get_size2::GetSize, salsa::SalsaValue)]\n    ++pub(crate) struct CallBinOpError<'db> {\n    ++    /// Includes methods that were called but returned only `NotImplemented`.\n    ++    pub(super) deprecated_functions: Box<[OverloadLiteral<'db>]>,\n    + }\n    + \n    +-impl From<CallDunderError<'_>> for CallBinOpError {\n    +-    fn from(value: CallDunderError<'_>) -> Self {\n    +-        match value {\n    +-            CallDunderError::CallError(_, _, _) => Self::CallError,\n    +-            CallDunderError::MethodNotAvailable | CallDunderError::PossiblyUnbound { .. } => {\n    +-                CallBinOpError::NotSupported\n    +-            }\n    ++impl<'db> CallBinOpError<'db> {\n    ++    fn from_call(db: &'db dyn Db, call: BinaryOperatorCall<'db>) -> Self {\n    ++        Self {\n    ++            deprecated_functions: call.into_result(db).deprecated_functions,\n    +         }\n    +     }\n    + }\n    +\n    + ## crates/ty_python_semantic/src/types/ide_support.rs ##\n    +@@ crates/ty_python_semantic/src/types/ide_support.rs: pub fn definitions_for_bin_op<'db>(\n    +     let left_ty = binary_op.left.inferred_type(model)?;\n    +     let right_ty = binary_op.right.inferred_type(model)?;\n    +     let env = &model.program_environment();\n    +-    let Ok(bindings) = Type::try_call_bin_op(db, env, left_ty, binary_op.op, right_ty) else {\n    ++    let Ok(call) = Type::try_call_bin_op(db, env, left_ty, binary_op.op, right_ty) else {\n    +         return None;\n    +     };\n    ++    let bindings = call.bindings;\n    + \n    +     let callable_type = promote_for_self(db, env, bindings.callable_type());\n    + \n    +\n      ## crates/ty_python_semantic/src/types/infer/builder.rs ##\n     @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n                          &mut |builder, (_, _, tcx)| infer_value_ty(builder, tcx),\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                                  value_ty,\n                              );\n     -                        Err(bindings.return_type(db, env))\n    -+                        return Err(bindings.return_type(db, env));\n    ++                        let (return_type, may_decline) =\n    ++                            bindings.return_type(db, env).split_not_implemented(db, env);\n    ++                        return Err(if may_decline {\n    ++                            UnionType::from_two_elements(db, env, return_type, Type::unknown())\n    ++                        } else {\n    ++                            return_type\n    ++                        });\n                          }\n     +                };\n     +                state.deprecated_functions.extend(\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n     +                        .map(|(_, function)| function),\n     +                );\n     +\n    -+                // Returning NotImplemented requests the ordinary binary operation; it is\n    -+                // never assigned back to the target. Other return alternatives still apply.\n    -+                let return_ty = outcome.return_type(db, env);\n    -+                let expanded_return_ty = return_ty.expand_top_level_aliases(db, env);\n    -+                let assigned_ty = match expanded_return_ty {\n    -+                    Type::Union(union) => union.filter(db, |ty| !ty.is_notimplemented(db)),\n    -+                    ty => {\n    -+                        if ty.is_notimplemented(db) {\n    -+                            Type::Never\n    -+                        } else {\n    -+                            ty\n    -+                        }\n    -+                    }\n    -+                };\n    -+                let assigned_ty = if assigned_ty == expanded_return_ty {\n    -+                    if !possibly_unbound {\n    -+                        return Ok(return_ty);\n    -+                    }\n    -+                    return_ty\n    -+                } else {\n    -+                    assigned_ty\n    -+                };\n    ++                let (assigned_ty, may_decline) =\n    ++                    outcome.return_type(db, env).split_not_implemented(db, env);\n    ++                if !possibly_unbound && !may_decline {\n    ++                    return Ok(assigned_ty);\n    ++                }\n     +\n     +                let value_ty = outcome.type_for_argument(&call_arguments, 0);\n     +                match binary_return_ty(self, value_ty, state) {\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                      }\n                  }\n              }\n    +\n    + ## crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs ##\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: use compact_str::CompactString;\n    + use ruff_python_ast::{self as ast, AnyNodeRef};\n    + \n    + use super::TypeInferenceBuilder;\n    +-use crate::types::call::CallArguments;\n    ++use crate::types::call::{CallArguments, CallBinOpError, OperatorResult};\n    + use crate::types::constraints::ConstraintSetBuilder;\n    + use crate::types::cyclic::CycleDetector;\n    + use crate::types::diagnostic::{\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: pub(super) struct BinaryInferenceState<'db> {\n    + }\n    + \n    + impl<'db> BinaryInferenceState<'db> {\n    ++    fn record_operator_result(\n    ++        &mut self,\n    ++        result: Result<&OperatorResult<'db>, &CallBinOpError<'db>>,\n    ++    ) -> Option<Type<'db>> {\n    ++        match result {\n    ++            Ok(result) => {\n    ++                self.deprecated_functions\n    ++                    .extend(&result.deprecated_functions);\n    ++                Some(result.return_type)\n    ++            }\n    ++            Err(error) => {\n    ++                self.deprecated_functions\n    ++                    .extend(&error.deprecated_functions);\n    ++                None\n    ++            }\n    ++        }\n    ++    }\n    ++\n    +     fn tuple_alternative_count(db: &'db dyn Db, ty: Type<'db>) -> usize {\n    +         match ty {\n    +             Type::Union(union) => union\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: impl<'db> TypeInferenceBuilder<'db, '_> {\n    +             left_ty,\n    +             op,\n    +             right_ty,\n    +-        )?;\n    +-        state\n    +-            .deprecated_functions\n    +-            .extend(&result.deprecated_functions);\n    +-        Some(result.return_type)\n    ++        );\n    ++        state.record_operator_result(result)\n    +     }\n    + \n    +     /// Infer the result type and collect deprecated methods for the enclosing operation.\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: impl<'db> TypeInferenceBuilder<'db, '_> {\n    +                 _,\n    +                 Type::ClassLiteral(..) | Type::GenericAlias(..) | Type::SubclassOf(..),\n    +                 ast::Operator::BitOr,\n    +-            ) => Type::try_call_bin_op_with_policy(\n    +-                db,\n    +-                env,\n    +-                left_ty,\n    +-                ast::Operator::BitOr,\n    +-                right_ty,\n    +-                MemberLookupPolicy::META_CLASS_NO_TYPE_FALLBACK,\n    +-            )\n    +-            .ok()\n    +-            .map(|binding| {\n    +-                state.deprecated_functions.extend(\n    +-                    binding\n    +-                        .deprecated_functions(db)\n    +-                        .map(|(_, function)| function),\n    +-                );\n    +-                binding.return_type(db, env)\n    +-            }),\n    ++            ) => {\n    ++                let result = Type::try_call_bin_op_with_policy(\n    ++                    db,\n    ++                    env,\n    ++                    left_ty,\n    ++                    ast::Operator::BitOr,\n    ++                    right_ty,\n    ++                    MemberLookupPolicy::META_CLASS_NO_TYPE_FALLBACK,\n    ++                )\n    ++                .map(|call| call.into_result(db));\n    ++                state.record_operator_result(result.as_ref())\n    ++            }\n    + \n    +             // We've handled all of the special cases that we support for literals, so we need to\n    +             // fall back on looking for dunder methods on one of the operand types.\n```\n",
          "outcome": "approved",
          "approvedAt": "2026-11-25T12:41:14.101073Z"
        },
        {
          "kind": "amendment",
          "status": "posted",
          "head": "88b15ebe27958d0cdac952904b9f4d497c0a0d18",
          "baseHead": "0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9",
          "url": "https://github.com/tamird/ruff/commit/88b15ebe27958d0cdac952904b9f4d497c0a0d18",
          "title": "Published arithmetic amendment range-diff",
          "summary": "Approved 88b15ebe is published on PR #30898; current GitHub checks are recorded separately.",
          "body": "Review the replacement for Ruff #30898: published `0af5b7f2e` → proposed `88b15ebe27`. Both commits use upstream `3f63e8b36` as their base.\n\nThe revision handles `NotImplemented` in ordinary and reflected arithmetic as well as augmented assignments. Existing successful-result annotations and parameter-based fallback remain supported. Direct method calls retain their original return types. Callability errors block reflection; methods on two operands with the same known runtime class are not retried as reflected calls.\n\nThe original two regression fixtures fail on published `0af5b7f2e`. The candidate passes core 86, semantic 539 (35 ignored), IDE 1,964, all 532 default Markdown tests, canonical hooks, formatting and strict Clippy. [Qualification](https://app.buildbuddy.io/invocation/f6a9e652-fe1f-4866-b3f2-251ac7fa181d); [published-head controls](https://app.buildbuddy.io/invocation/dd07a677-6774-4678-89c6-55ccc1bb30fb).\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/88b15ebe27958d0cdac952904b9f4d497c0a0d18).\n\n## Changes from the submitted commit\n\nThis is Git's actual paired range-diff of the two single-commit proposals.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 3f63e8b368924bb58875a7590e07f667805839a5..0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9 3f63e8b368924bb58875a7590e07f667805839a5..88b15ebe27958d0cdac952904b9f4d497c0a0d18\n```\n\n```diff\n1:  0af5b7f2e0 ! 1:  88b15ebe27 [ty] Honor NotImplemented in augmented assignments\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Honor NotImplemented in augmented assignments\n    +    [ty] Honor NotImplemented in binary operators\n     \n    -    An in-place method can return NotImplemented to request the ordinary\n    -    binary operation. That result was instead assigned to the target,\n    -    bypassing ordinary and reflected dispatch and missing unsupported-operand\n    -    errors.\n    +    Binary dispatch stopped when a method returned NotImplemented, so\n    +    arithmetic could infer the sentinel instead of trying a reflected method\n    +    or reporting an unsupported operation. The in-place fallback could\n    +    expose the same result after __iadd__ declined.\n     \n    -    Remove the sentinel alternatives and use the existing binary dispatch for\n    -    them. Retain other return alternatives and the fallback for conditionally\n    -    defined in-place methods.\n    +    Treat NotImplemented as a request to continue dispatch, preserving other\n    +    return alternatives when fallback succeeds. Conditionally defined\n    +    methods also retain their own return types alongside the fallback. Reuse\n    +    this partition for in-place results. Keep original call bindings for\n    +    navigation and retain deprecation warnings from methods that decline the\n    +    operation.\n    +\n    +    Distinguish unavailable methods from methods that may not be callable;\n    +    the latter can raise before reflection. Suppress reflected calls when\n    +    both operands have the same exact runtime class [1]. This includes\n    +    different specializations of a final generic class.\n    +\n    +    Conventional successful-result annotations and parameter-based fallback\n    +    remain supported; direct method calls keep their annotated or inferred\n    +    return types. This does not change the annotation validation discussed\n    +    in [2].\n    +\n    +    [1]: https://docs.python.org/3/reference/datamodel.html#object.__radd__\n    +    [2]: https://github.com/astral-sh/ty/issues/1150\n     \n      ## crates/ty_python_semantic/resources/mdtest/assignment/augmented.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/assignment/augmented.md: x += \"Hello\"\n    @@ crates/ty_python_semantic/resources/mdtest/assignment/augmented.md: x += \"Hello\"\n     +Returning `NotImplemented` requests ordinary binary dispatch, including the reflected method. The\n     +sentinel is never assigned to the target; other in-place return alternatives are retained.\n     +\n    ++```toml\n    ++[analysis]\n    ++return-type-inference = \"always\"\n    ++```\n    ++\n     +```py\n     +from types import NotImplementedType\n    ++from typing import final\n     +\n     +InPlaceResult = int | NotImplementedType\n     +\n    ++@final\n     +class Left:\n    -+    def __iadd__(self, other: object) -> NotImplementedType:\n    ++    def __iadd__(self, other: object):\n     +        return NotImplemented\n     +\n     +    def __add__(self, other: int) -> str:\n     +        return \"added\"\n     +\n     +class Right:\n    -+    def __radd__(self, other: Left) -> bytes:\n    ++    def __radd__(self, other: object) -> bytes:\n     +        return b\"reflected\"\n     +\n     +left = Left()\n    @@ crates/ty_python_semantic/resources/mdtest/assignment/augmented.md: x += \"Hello\"\n     +mixed = Mixed()\n     +mixed += 1\n     +reveal_type(mixed)  # revealed: int | str\n    ++\n    ++@final\n    ++class Declines:\n    ++    def __iadd__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++    def __add__(self, other: object):\n    ++        return NotImplemented\n    ++\n    ++both = Declines()\n    ++both += Right()\n    ++reveal_type(both)  # revealed: bytes\n     +```\n     +\n      ## Unsupported types\n      \n      ```py\n     \n    + ## crates/ty_python_semantic/resources/mdtest/binary/instances.md ##\n    +@@ crates/ty_python_semantic/resources/mdtest/binary/instances.md: class GenericChild(GenericBase[T]):\n    + def add_generic(left: GenericBase[int], right: GenericChild[str]) -> Literal[\"left\", \"right\"]:\n    +     reveal_type(left + right)  # revealed: Literal[\"right\", \"left\"]\n    +     return left + right\n    ++\n    ++from types import NotImplementedType\n    ++from typing import final\n    ++\n    ++@final\n    ++class Box(Generic[T]):\n    ++    value: T\n    ++\n    ++    def __add__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++    def __radd__(self, other: object) -> int:\n    ++        return 1\n    ++\n    ++def same_runtime_class(left: Box[int], right: Box[str]):\n    ++    # error: [unsupported-operator]\n    ++    reveal_type(left + right)  # revealed: Unknown\n    + ```\n    + \n    + ## Class objects use their metaclasses for reflected precedence\n    +@@ crates/ty_python_semantic/resources/mdtest/binary/instances.md: class B:\n    + reveal_type(A() - B())  # revealed: B\n    + ```\n    + \n    ++## Methods returning `NotImplemented`\n    ++\n    ++An explicit or inferred `NotImplemented` return tries the next method. Direct calls retain the\n    ++method's return type:\n    ++\n    ++```toml\n    ++[analysis]\n    ++return-type-inference = \"always\"\n    ++```\n    ++\n    ++```py\n    ++from types import NotImplementedType\n    ++from typing import final\n    ++\n    ++class Reflected:\n    ++    def __radd__(self, other: object) -> int:\n    ++        return 1\n    ++\n    ++@final\n    ++class Inferred:\n    ++    def __add__(self, other: object):\n    ++        if isinstance(other, bytes):\n    ++            return other\n    ++        return NotImplemented\n    ++\n    ++reveal_type(Inferred().__add__(Reflected()))  # revealed: bytes | NotImplementedType\n    ++reveal_type(Inferred() + Reflected())  # revealed: bytes | int\n    ++\n    ++# error: [unsupported-operator]\n    ++reveal_type(Inferred() + object())  # revealed: Unknown\n    ++\n    ++class Declines:\n    ++    def __add__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++    def __radd__(self, other: object) -> int:\n    ++        return 1\n    ++\n    ++reveal_type(Declines() + Reflected())  # revealed: int\n    ++\n    ++# Reflected methods are not tried for two operands of the same runtime type.\n    ++# error: [unsupported-operator]\n    ++reveal_type(Declines() + Declines())  # revealed: Unknown\n    ++\n    ++class Refuses:\n    ++    def __radd__(self, other: object) -> NotImplementedType:\n    ++        return NotImplemented\n    ++\n    ++# error: [unsupported-operator]\n    ++reveal_type(Declines() + Refuses())  # revealed: Unknown\n    ++\n    ++class Blocked:\n    ++    __add__ = None\n    ++\n    ++# A non-callable method raises instead of trying the reflected method.\n    ++# error: [unsupported-operator]\n    ++reveal_type(Blocked() + Reflected())  # revealed: Unknown\n    ++```\n    ++\n    + ## Callable instances as dunders\n    + \n    + Believe it or not, this is supported at runtime:\n    +\n    + ## crates/ty_python_semantic/src/types/call.rs ##\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> OperatorResult<'db> {\n    +         db: &'db dyn Db,\n    +         env: &ProgramEnvironment<'db>,\n    +         bindings: &Bindings<'db>,\n    ++    ) -> Self {\n    ++        Self::from_bindings_and_return_type(db, bindings, bindings.return_type(db, env))\n    ++    }\n    ++\n    ++    fn from_bindings_and_return_type(\n    ++        db: &'db dyn Db,\n    ++        bindings: &Bindings<'db>,\n    ++        return_type: Type<'db>,\n    +     ) -> Self {\n    +         Self {\n    +-            return_type: bindings.return_type(db, env),\n    ++            return_type,\n    +             deprecated_functions: bindings\n    +                 .deprecated_functions(db)\n    +                 .map(|(_, function)| function)\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> OperatorResult<'db> {\n    +     }\n    + }\n    + \n    ++/// The methods called by a binary operation and its result after `NotImplemented` fallback.\n    ++///\n    ++/// Method bindings retain their original return types for IDE navigation. Arithmetic syntax\n    ++/// uses a separate result after `NotImplemented` fallback.\n    ++pub(crate) struct BinaryOperatorCall<'db> {\n    ++    pub(super) bindings: Bindings<'db>,\n    ++    pub(super) return_type: Type<'db>,\n    ++}\n    ++\n    ++impl<'db> BinaryOperatorCall<'db> {\n    ++    fn union(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, other: Self) -> Self {\n    ++        let Self {\n    ++            bindings: left,\n    ++            return_type: left_type,\n    ++        } = self;\n    ++        let Self {\n    ++            bindings: right,\n    ++            return_type: right_type,\n    ++        } = other;\n    ++        let callable_type =\n    ++            UnionType::from_two_elements(db, env, left.callable_type(), right.callable_type());\n    ++        Self {\n    ++            bindings: Bindings::from_union(callable_type, [left, right]),\n    ++            return_type: UnionType::from_two_elements(db, env, left_type, right_type),\n    ++        }\n    ++    }\n    ++\n    ++    pub(super) fn into_result(self, db: &'db dyn Db) -> OperatorResult<'db> {\n    ++        let Self {\n    ++            bindings,\n    ++            return_type,\n    ++        } = self;\n    ++        OperatorResult::from_bindings_and_return_type(db, &bindings, return_type)\n    ++    }\n    ++}\n    ++\n    ++#[expect(\n    ++    clippy::large_enum_variant,\n    ++    reason = \"Boxing adds an allocation to each successful call\"\n    ++)]\n    ++enum OperatorCallOutcome<'db> {\n    ++    Called {\n    ++        call: BinaryOperatorCall<'db>,\n    ++        /// The method can return `NotImplemented` or may not be defined at runtime.\n    ++        may_fall_through: bool,\n    ++    },\n    ++    Unavailable,\n    ++    Blocked,\n    ++}\n    ++\n    ++impl<'db> OperatorCallOutcome<'db> {\n    ++    fn into_error(self, db: &'db dyn Db) -> CallBinOpError<'db> {\n    ++        match self {\n    ++            Self::Called {\n    ++                call,\n    ++                may_fall_through: _,\n    ++            } => CallBinOpError::from_call(db, call),\n    ++            Self::Unavailable => CallBinOpError::default(),\n    ++            Self::Blocked => CallBinOpError::default(),\n    ++        }\n    ++    }\n    ++}\n    ++\n    ++fn operator_call_outcome<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    call: Result<Bindings<'db>, CallDunderError<'db>>,\n    ++) -> OperatorCallOutcome<'db> {\n    ++    let (bindings, possibly_unbound) = match call {\n    ++        Ok(bindings) => (bindings, false),\n    ++        Err(error) => match error {\n    ++            CallDunderError::PossiblyUnbound {\n    ++                bindings,\n    ++                unbound_on: _,\n    ++            } => (*bindings, true),\n    ++            CallDunderError::MethodNotAvailable => return OperatorCallOutcome::Unavailable,\n    ++            CallDunderError::CallError(kind, _, _) => match kind {\n    ++                // Calling a non-callable method can raise before reflection, even if other\n    ++                // possible method types are callable.\n    ++                CallErrorKind::NotCallable => return OperatorCallOutcome::Blocked,\n    ++                CallErrorKind::PossiblyNotCallable => return OperatorCallOutcome::Blocked,\n    ++                // Keep parameter-based fallback for the existing annotation convention.\n    ++                CallErrorKind::BindingError => return OperatorCallOutcome::Unavailable,\n    ++            },\n    ++        },\n    ++    };\n    ++    let (return_type, may_decline) = bindings.return_type(db, env).split_not_implemented(db, env);\n    ++    OperatorCallOutcome::Called {\n    ++        call: BinaryOperatorCall {\n    ++            bindings,\n    ++            return_type,\n    ++        },\n    ++        may_fall_through: may_decline || possibly_unbound,\n    ++    }\n    ++}\n    ++\n    ++fn resolve_ordered_operator_calls<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    first: OperatorCallOutcome<'db>,\n    ++    fallback: impl FnOnce() -> OperatorCallOutcome<'db>,\n    ++) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    ++    let first = match first {\n    ++        OperatorCallOutcome::Called {\n    ++            call,\n    ++            may_fall_through,\n    ++        } => {\n    ++            if !may_fall_through {\n    ++                return Ok(call);\n    ++            }\n    ++            Some(call)\n    ++        }\n    ++        OperatorCallOutcome::Unavailable => None,\n    ++        OperatorCallOutcome::Blocked => return Err(CallBinOpError::default()),\n    ++    };\n    ++    match fallback() {\n    ++        OperatorCallOutcome::Called {\n    ++            call: second,\n    ++            may_fall_through,\n    ++        } => {\n    ++            let call = match first {\n    ++                Some(first) => first.union(db, env, second),\n    ++                None => second,\n    ++            };\n    ++            if may_fall_through {\n    ++                Err(CallBinOpError::from_call(db, call))\n    ++            } else {\n    ++                Ok(call)\n    ++            }\n    ++        }\n    ++        OperatorCallOutcome::Unavailable => Err(match first {\n    ++            Some(call) => CallBinOpError::from_call(db, call),\n    ++            None => CallBinOpError::default(),\n    ++        }),\n    ++        OperatorCallOutcome::Blocked => Err(match first {\n    ++            Some(call) => CallBinOpError::from_call(db, call),\n    ++            None => CallBinOpError::default(),\n    ++        }),\n    ++    }\n    ++}\n    ++\n    ++fn resolve_possible_operator_calls<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    first: OperatorCallOutcome<'db>,\n    ++    second: OperatorCallOutcome<'db>,\n    ++) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    ++    let (call, may_fall_through) = match first {\n    ++        OperatorCallOutcome::Blocked => return Err(second.into_error(db)),\n    ++        OperatorCallOutcome::Unavailable => match second {\n    ++            OperatorCallOutcome::Called {\n    ++                call,\n    ++                may_fall_through,\n    ++            } => (call, may_fall_through),\n    ++            OperatorCallOutcome::Unavailable => return Err(CallBinOpError::default()),\n    ++            OperatorCallOutcome::Blocked => return Err(CallBinOpError::default()),\n    ++        },\n    ++        OperatorCallOutcome::Called {\n    ++            call: first,\n    ++            may_fall_through: first_declines,\n    ++        } => match second {\n    ++            OperatorCallOutcome::Called {\n    ++                call: second,\n    ++                may_fall_through: second_declines,\n    ++            } => (\n    ++                first.union(db, env, second),\n    ++                first_declines && second_declines,\n    ++            ),\n    ++            OperatorCallOutcome::Unavailable => (first, first_declines),\n    ++            OperatorCallOutcome::Blocked => return Err(CallBinOpError::from_call(db, first)),\n    ++        },\n    ++    };\n    ++    if may_fall_through {\n    ++        Err(CallBinOpError::from_call(db, call))\n    ++    } else {\n    ++        Ok(call)\n    ++    }\n    ++}\n    ++\n    + /// Whether the right operand's reflected method has priority based on the possible runtime\n    + /// classes of both operands.\n    + ///\n    +@@ crates/ty_python_semantic/src/types/call.rs: fn reflected_method_priority<'db>(\n    + }\n    + \n    + impl<'db> Type<'db> {\n    ++    /// Separate operator result values from a request to try another method.\n    ++    pub(super) fn split_not_implemented(\n    ++        self,\n    ++        db: &'db dyn Db,\n    ++        env: &ProgramEnvironment<'db>,\n    ++    ) -> (Self, bool) {\n    ++        let expanded = self.expand_top_level_aliases(db, env);\n    ++        let completing = match expanded {\n    ++            Type::Union(union) => union.filter(db, |ty| !ty.is_notimplemented(db)),\n    ++            ty => {\n    ++                if ty.is_notimplemented(db) {\n    ++                    Type::Never\n    ++                } else {\n    ++                    ty\n    ++                }\n    ++            }\n    ++        };\n    ++        if completing == expanded {\n    ++            (self, false)\n    ++        } else {\n    ++            (completing, true)\n    ++        }\n    ++    }\n    ++\n    +     /// Return the result of dispatching a rich comparison method between two operands.\n    +     ///\n    +     /// A strict subclass on the right takes precedence over the normal method on the left.\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> Type<'db> {\n    + \n    +     /// Memoize the return type and deprecations from binary dunder resolution, without retaining\n    +     /// the full call bindings or repeating overload selection at each expression.\n    +-    /// Returns `None` if resolution fails; callers remain responsible for call-site diagnostics.\n    ++    /// Failed resolution retains called-method metadata;\n    ++    /// callers remain responsible for call-site diagnostics.\n    +     pub(crate) fn try_call_bin_op_result(\n    +         db: &'db dyn Db,\n    +         env: &ProgramEnvironment<'db>,\n    +         left_ty: Type<'db>,\n    +         op: ast::Operator,\n    +         right_ty: Type<'db>,\n    +-    ) -> Option<&'db OperatorResult<'db>> {\n    +-        #[salsa::tracked(returns(ref), cycle_initial=|_, _, _, _, _, _, _| None, heap_size=ruff_memory_usage::heap_size)]\n    ++    ) -> Result<&'db OperatorResult<'db>, &'db CallBinOpError<'db>> {\n    ++        #[salsa::tracked(returns(ref), cycle_initial=|_, _, _, _, _, _, _| Err(CallBinOpError::default()), heap_size=ruff_memory_usage::heap_size)]\n    +         fn try_call_bin_op_result_impl<'db>(\n    +             db: &'db dyn Db,\n    +             program: Program<'db>,\n    +             left_ty: Type<'db>,\n    +             op: ast::Operator,\n    +             right_ty: Type<'db>,\n    +-        ) -> Option<OperatorResult<'db>> {\n    ++        ) -> Result<OperatorResult<'db>, CallBinOpError<'db>> {\n    +             let env = &ProgramEnvironment::from_program(program);\n    +-            Type::try_call_bin_op(db, env, left_ty, op, right_ty)\n    +-                .ok()\n    +-                .map(|bindings| OperatorResult::from_bindings(db, env, &bindings))\n    ++            Type::try_call_bin_op(db, env, left_ty, op, right_ty).map(|call| call.into_result(db))\n    +         }\n    + \n    +         try_call_bin_op_result_impl(db, env.program(db), left_ty, op, right_ty).as_ref()\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> Type<'db> {\n    +         left_ty: Type<'db>,\n    +         op: ast::Operator,\n    +         right_ty: Type<'db>,\n    +-    ) -> Result<Bindings<'db>, CallBinOpError> {\n    ++    ) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    +         Self::try_call_bin_op_with_policy(\n    +             db,\n    +             env,\n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> Type<'db> {\n    +         op: ast::Operator,\n    +         right_ty: Type<'db>,\n    +         policy: MemberLookupPolicy,\n    +-    ) -> Result<Bindings<'db>, CallBinOpError> {\n    +-        // We either want to call lhs.__op__ or rhs.__rop__. The full decision tree from\n    +-        // the Python spec [1] is:\n    +-        //\n    +-        //   - If rhs is a (proper) subclass of lhs, and it provides a different\n    +-        //     implementation of __rop__, use that.\n    +-        //   - Otherwise, if lhs implements __op__, use that.\n    +-        //   - Otherwise, if lhs and rhs are different types, and rhs implements __rop__,\n    +-        //     use that.\n    +-        //\n    +-        // [1] https://docs.python.org/3/reference/datamodel.html#object.__radd__\n    +-\n    +-        // Runtime classes determine reflected priority, but static operand types may only\n    +-        // establish that priority conditionally.\n    ++    ) -> Result<BinaryOperatorCall<'db>, CallBinOpError<'db>> {\n    ++        // A different reflected implementation on a proper subclass is tried first.\n    ++        // A method that returns NotImplemented lets the next method run; parameter\n    ++        // binding failures retain their existing fallback behavior.\n    ++        let call_dunder = |receiver: Type<'db>, argument: Type<'db>, name| {\n    ++            operator_call_outcome(\n    ++                db,\n    ++                env,\n    ++                receiver.try_call_dunder_with_policy(\n    ++                    db,\n    ++                    env,\n    ++                    name,\n    ++                    &mut CallArguments::positional([argument]),\n    ++                    TypeContext::default(),\n    ++                    policy,\n    ++                ),\n    ++            )\n    ++        };\n    ++        let call_left = || call_dunder(left_ty, right_ty, op.dunder());\n    ++        let call_right = || {\n    ++            if left_ty == right_ty {\n    ++                return OperatorCallOutcome::Unavailable;\n    ++            }\n    ++            // Different specializations can still have the same exact runtime class.\n    ++            let same_runtime_class = has_exact_runtime_class(db, env, left_ty)\n    ++                && has_exact_runtime_class(db, env, right_ty)\n    ++                && operator_dispatch_class(db, env, left_ty)\n    ++                    .zip(operator_dispatch_class(db, env, right_ty))\n    ++                    .is_some_and(|(left, right)| left.class_literal(db) == right.class_literal(db));\n    ++            if same_runtime_class {\n    ++                OperatorCallOutcome::Unavailable\n    ++            } else {\n    ++                call_dunder(right_ty, left_ty, op.reflected_dunder())\n    ++            }\n    ++        };\n    +         let reflected_priority = reflected_method_priority(db, env, left_ty, right_ty);\n    +-\n    +-        let left_class = left_ty.to_meta_type(db, env);\n    +-        let right_class = right_ty.to_meta_type(db, env);\n    +         if reflected_priority != ReflectedMethodPriority::Never {\n    +             let reflected_dunder = op.reflected_dunder();\n    ++            let left_class = left_ty.to_meta_type(db, env);\n    ++            let right_class = right_ty.to_meta_type(db, env);\n    +             let rhs_reflected = right_class.member(db, env, reflected_dunder).place;\n    +-            // TODO: if `rhs_reflected` is possibly unbound, we should union the two possible\n    +-            // Bindings together\n    +             if !rhs_reflected.is_undefined()\n    +                 && !rhs_reflected.is_equal_ignoring_provenance(\n    +                     left_class.member(db, env, reflected_dunder).place,\n    +                 )\n    +             {\n    +-                let call_on_right_instance = right_ty.try_call_dunder_with_policy(\n    +-                    db,\n    +-                    env,\n    +-                    reflected_dunder,\n    +-                    &mut CallArguments::positional([left_ty]),\n    +-                    TypeContext::default(),\n    +-                    policy,\n    +-                );\n    +-\n    +                 if reflected_priority == ReflectedMethodPriority::Definitely {\n    +-                    return Ok(call_on_right_instance.or_else(|_| {\n    +-                        left_ty.try_call_dunder_with_policy(\n    +-                            db,\n    +-                            env,\n    +-                            op.dunder(),\n    +-                            &mut CallArguments::positional([right_ty]),\n    +-                            TypeContext::default(),\n    +-                            policy,\n    +-                        )\n    +-                    })?);\n    ++                    return resolve_ordered_operator_calls(db, env, call_right(), call_left);\n    +                 }\n    +-\n    +-                let call_on_left_instance = left_ty.try_call_dunder_with_policy(\n    +-                    db,\n    +-                    env,\n    +-                    op.dunder(),\n    +-                    &mut CallArguments::positional([right_ty]),\n    +-                    TypeContext::default(),\n    +-                    policy,\n    +-                );\n    +-\n    +-                return match (call_on_right_instance, call_on_left_instance) {\n    +-                    (Ok(right_bindings), Ok(left_bindings)) => {\n    +-                        let callable_type = UnionType::from_two_elements(\n    +-                            db,\n    +-                            env,\n    +-                            right_bindings.callable_type(),\n    +-                            left_bindings.callable_type(),\n    +-                        );\n    +-                        Ok(Bindings::from_union(\n    +-                            callable_type,\n    +-                            [right_bindings, left_bindings],\n    +-                        ))\n    +-                    }\n    +-                    (Ok(bindings), Err(_)) | (Err(_), Ok(bindings)) => Ok(bindings),\n    +-                    (Err(_), Err(error)) => Err(error.into()),\n    +-                };\n    ++                // Either method may have runtime priority. Both are evaluated once; if\n    ++                // either always completes, neither ordering can exhaust both methods.\n    ++                return resolve_possible_operator_calls(db, env, call_right(), call_left());\n    +             }\n    +         }\n    +-\n    +-        let call_on_left_instance = left_ty.try_call_dunder_with_policy(\n    +-            db,\n    +-            env,\n    +-            op.dunder(),\n    +-            &mut CallArguments::positional([right_ty]),\n    +-            TypeContext::default(),\n    +-            policy,\n    +-        );\n    +-\n    +-        call_on_left_instance.or_else(|_| {\n    +-            if left_ty == right_ty {\n    +-                Err(CallBinOpError::NotSupported)\n    +-            } else {\n    +-                Ok(right_ty.try_call_dunder_with_policy(\n    +-                    db,\n    +-                    env,\n    +-                    op.reflected_dunder(),\n    +-                    &mut CallArguments::positional([left_ty]),\n    +-                    TypeContext::default(),\n    +-                    policy,\n    +-                )?)\n    +-            }\n    +-        })\n    ++        resolve_ordered_operator_calls(db, env, call_left(), call_right)\n    +     }\n    + }\n    + \n    +@@ crates/ty_python_semantic/src/types/call.rs: impl<'db> CallDunderError<'db> {\n    +     }\n    + }\n    + \n    +-#[derive(Debug)]\n    +-pub(crate) enum CallBinOpError {\n    +-    /// The dunder attribute exists but it can't be called with the given arguments.\n    +-    ///\n    +-    /// This includes non-callable dunder attributes that are possibly unbound.\n    +-    CallError,\n    +-\n    +-    NotSupported,\n    ++/// Called-method metadata retained when a binary operation is unsupported.\n    ++#[derive(Clone, Debug, Default, PartialEq, Eq, get_size2::GetSize, salsa::SalsaValue)]\n    ++pub(crate) struct CallBinOpError<'db> {\n    ++    /// Includes methods that were called but returned only `NotImplemented`.\n    ++    pub(super) deprecated_functions: Box<[OverloadLiteral<'db>]>,\n    + }\n    + \n    +-impl From<CallDunderError<'_>> for CallBinOpError {\n    +-    fn from(value: CallDunderError<'_>) -> Self {\n    +-        match value {\n    +-            CallDunderError::CallError(_, _, _) => Self::CallError,\n    +-            CallDunderError::MethodNotAvailable | CallDunderError::PossiblyUnbound { .. } => {\n    +-                CallBinOpError::NotSupported\n    +-            }\n    ++impl<'db> CallBinOpError<'db> {\n    ++    fn from_call(db: &'db dyn Db, call: BinaryOperatorCall<'db>) -> Self {\n    ++        Self {\n    ++            deprecated_functions: call.into_result(db).deprecated_functions,\n    +         }\n    +     }\n    + }\n    +\n    + ## crates/ty_python_semantic/src/types/ide_support.rs ##\n    +@@ crates/ty_python_semantic/src/types/ide_support.rs: pub fn definitions_for_bin_op<'db>(\n    +     let left_ty = binary_op.left.inferred_type(model)?;\n    +     let right_ty = binary_op.right.inferred_type(model)?;\n    +     let env = &model.program_environment();\n    +-    let Ok(bindings) = Type::try_call_bin_op(db, env, left_ty, binary_op.op, right_ty) else {\n    ++    let Ok(call) = Type::try_call_bin_op(db, env, left_ty, binary_op.op, right_ty) else {\n    +         return None;\n    +     };\n    ++    let bindings = call.bindings;\n    + \n    +     let callable_type = promote_for_self(db, env, bindings.callable_type());\n    + \n    +\n      ## crates/ty_python_semantic/src/types/infer/builder.rs ##\n     @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n                          &mut |builder, (_, _, tcx)| infer_value_ty(builder, tcx),\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                                  value_ty,\n                              );\n     -                        Err(bindings.return_type(db, env))\n    -+                        return Err(bindings.return_type(db, env));\n    ++                        let (return_type, may_decline) =\n    ++                            bindings.return_type(db, env).split_not_implemented(db, env);\n    ++                        return Err(if may_decline {\n    ++                            UnionType::from_two_elements(db, env, return_type, Type::unknown())\n    ++                        } else {\n    ++                            return_type\n    ++                        });\n                          }\n     +                };\n     +                state.deprecated_functions.extend(\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n     +                        .map(|(_, function)| function),\n     +                );\n     +\n    -+                // Returning NotImplemented requests the ordinary binary operation; it is\n    -+                // never assigned back to the target. Other return alternatives still apply.\n    -+                let return_ty = outcome.return_type(db, env);\n    -+                let expanded_return_ty = return_ty.expand_top_level_aliases(db, env);\n    -+                let assigned_ty = match expanded_return_ty {\n    -+                    Type::Union(union) => union.filter(db, |ty| !ty.is_notimplemented(db)),\n    -+                    ty => {\n    -+                        if ty.is_notimplemented(db) {\n    -+                            Type::Never\n    -+                        } else {\n    -+                            ty\n    -+                        }\n    -+                    }\n    -+                };\n    -+                let assigned_ty = if assigned_ty == expanded_return_ty {\n    -+                    if !possibly_unbound {\n    -+                        return Ok(return_ty);\n    -+                    }\n    -+                    return_ty\n    -+                } else {\n    -+                    assigned_ty\n    -+                };\n    ++                let (assigned_ty, may_decline) =\n    ++                    outcome.return_type(db, env).split_not_implemented(db, env);\n    ++                if !possibly_unbound && !may_decline {\n    ++                    return Ok(assigned_ty);\n    ++                }\n     +\n     +                let value_ty = outcome.type_for_argument(&call_arguments, 0);\n     +                match binary_return_ty(self, value_ty, state) {\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                      }\n                  }\n              }\n    +\n    + ## crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs ##\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: use compact_str::CompactString;\n    + use ruff_python_ast::{self as ast, AnyNodeRef};\n    + \n    + use super::TypeInferenceBuilder;\n    +-use crate::types::call::CallArguments;\n    ++use crate::types::call::{CallArguments, CallBinOpError, OperatorResult};\n    + use crate::types::constraints::ConstraintSetBuilder;\n    + use crate::types::cyclic::CycleDetector;\n    + use crate::types::diagnostic::{\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: pub(super) struct BinaryInferenceState<'db> {\n    + }\n    + \n    + impl<'db> BinaryInferenceState<'db> {\n    ++    fn record_operator_result(\n    ++        &mut self,\n    ++        result: Result<&OperatorResult<'db>, &CallBinOpError<'db>>,\n    ++    ) -> Option<Type<'db>> {\n    ++        match result {\n    ++            Ok(result) => {\n    ++                self.deprecated_functions\n    ++                    .extend(&result.deprecated_functions);\n    ++                Some(result.return_type)\n    ++            }\n    ++            Err(error) => {\n    ++                self.deprecated_functions\n    ++                    .extend(&error.deprecated_functions);\n    ++                None\n    ++            }\n    ++        }\n    ++    }\n    ++\n    +     fn tuple_alternative_count(db: &'db dyn Db, ty: Type<'db>) -> usize {\n    +         match ty {\n    +             Type::Union(union) => union\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: impl<'db> TypeInferenceBuilder<'db, '_> {\n    +             left_ty,\n    +             op,\n    +             right_ty,\n    +-        )?;\n    +-        state\n    +-            .deprecated_functions\n    +-            .extend(&result.deprecated_functions);\n    +-        Some(result.return_type)\n    ++        );\n    ++        state.record_operator_result(result)\n    +     }\n    + \n    +     /// Infer the result type and collect deprecated methods for the enclosing operation.\n    +@@ crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs: impl<'db> TypeInferenceBuilder<'db, '_> {\n    +                 _,\n    +                 Type::ClassLiteral(..) | Type::GenericAlias(..) | Type::SubclassOf(..),\n    +                 ast::Operator::BitOr,\n    +-            ) => Type::try_call_bin_op_with_policy(\n    +-                db,\n    +-                env,\n    +-                left_ty,\n    +-                ast::Operator::BitOr,\n    +-                right_ty,\n    +-                MemberLookupPolicy::META_CLASS_NO_TYPE_FALLBACK,\n    +-            )\n    +-            .ok()\n    +-            .map(|binding| {\n    +-                state.deprecated_functions.extend(\n    +-                    binding\n    +-                        .deprecated_functions(db)\n    +-                        .map(|(_, function)| function),\n    +-                );\n    +-                binding.return_type(db, env)\n    +-            }),\n    ++            ) => {\n    ++                let result = Type::try_call_bin_op_with_policy(\n    ++                    db,\n    ++                    env,\n    ++                    left_ty,\n    ++                    ast::Operator::BitOr,\n    ++                    right_ty,\n    ++                    MemberLookupPolicy::META_CLASS_NO_TYPE_FALLBACK,\n    ++                )\n    ++                .map(|call| call.into_result(db));\n    ++                state.record_operator_result(result.as_ref())\n    ++            }\n    + \n    +             // We've handled all of the special cases that we support for literals, so we need to\n    +             // fall back on looking for dunder methods on one of the operand types.\n```\n",
          "outcome": "posted",
          "approvedAt": "2026-11-25T12:41:14.101073Z",
          "postedURL": "https://github.com/astral-sh/ruff/pull/30898",
          "postedAt": "2026-11-25T12:41:14.101073Z"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "88b15ebe27958d0cdac952904b9f4d497c0a0d18",
        "nextAction": "Matched RBE timings were 27.63 ms before and 27.52 ms after the change. A Ruff maintainer with Actions write access can rerun the hosted walltime job to check its reported regression."
      },
      "refinement": {
        "before": {
          "head": "0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9"
        },
        "after": {
          "head": "88b15ebe27958d0cdac952904b9f4d497c0a0d18"
        }
      }
    },
    {
      "id": "branch:fresh-collection-callback-context",
      "type": "branch",
      "repo": "tamird/ruff",
      "title": "Infer fresh collection argument contexts",
      "group": "ty",
      "status": "Assessment in progress",
      "ref": "upstream/fresh-collection-context-75fabee2",
      "url": "https://github.com/tamird/ruff/commit/ba712134db00258728314f30ae2a70d69de8728d",
      "evidence": [
        {
          "label": "75fabee2: native suites, style and all 532 Markdown cases",
          "url": "https://app.buildbuddy.io/invocation/0fe3d6a1-9b2c-46d2-b18f-080dd07a501d"
        },
        {
          "label": "Current 75f parent versus ba712: attrs ABBA and identical 45 diagnostics",
          "url": "https://app.buildbuddy.io/invocation/f0f911a0-d824-4172-8334-e7705a4f238f"
        },
        {
          "label": "75fabee2: four optimized no-LTO stress workloads",
          "url": "https://app.buildbuddy.io/invocation/7092fd82-a176-46b5-835d-cbb0bbcfee09"
        },
        {
          "label": "75fabee2: alternating 256-argument control",
          "url": "https://app.buildbuddy.io/invocation/6dc7e19e-2db1-4835-b927-8083fc1d1ec7"
        },
        {
          "label": "Same-key TypedDict lambda: identical rejection on parent and proposal",
          "url": "https://app.buildbuddy.io/invocation/aa34b3ee-ca23-4175-86b8-222152944556"
        },
        {
          "label": "Callback-list lambda: both revisions reject with different diagnostics",
          "url": "https://app.buildbuddy.io/invocation/454468bc-85ff-46e5-ad86-5dbd9d332c7d"
        },
        {
          "label": "Earlier cd2 base: attrs cold check and unchanged diagnostics",
          "url": "https://app.buildbuddy.io/invocation/634403bf-91ee-4103-b845-d57d42b61243"
        }
      ],
      "head": "ba712134db00258728314f30ae2a70d69de8728d",
      "summary": "Fresh collection arguments keep literal types supplied by other arguments in generic calls. Incompatible hints fall back to ordinary inference.\n\nHistorical qualification for ba712: Core, semantic and IDE tests, style and all 532 default Markdown cases pass on 75fabee2. Current-parent attrs checks used same-worker ABBA with 30 samples per phase: 405.077 to 415.182 ms (+2.495%), with all 45 diagnostics byte-identical. This is one maintained workload; three untimed helper entries do not prove projection reuse, benefit or broad performance neutrality. Optimized no-LTO stress checks cost 12.0% more for 256 homogeneous arguments, 19.6% for alternating types and 16.2% for 1,500 rejected hints. Both focused lambda probes are rejected by parent and proposal: the same-key pair has the identical int.lower error; the callback-list variant changes invalid-argument-type to a missing-attribute error inside the lambda. Neither demonstrates a newly rejected valid call or broadly resolves the speculative-diagnostics question. The earlier cd2 attrs evidence is historical and exercised only two hint attempts.\n\nThis proposal is not approved for upstream submission.",
      "followup": {
        "owner": "Agent",
        "sourceHead": "ba712134db00258728314f30ae2a70d69de8728d",
        "nextAction": "Simplify the design and prepare smaller, independently reviewable contributions. Do not bring the 749-line ba712 proposal back for review or merely split it cosmetically. Preserve independently declared literal donors inside fresh displays and final validation; contextual promotability does not establish an independent donor. The existing evidence is historical, not approval of the architecture."
      }
    },
    {
      "id": "pr:30758",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 30758,
      "title": "Preserve exception types through tuple aliases",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/30758",
      "summary": "Merged by AlexWaygood on November 22, 2026 as Ruff #30758. The approved e752397 revision resolves the outer exception type alias once, preserving class and tuple alternatives in the caught value.\n\nThe current e752397 amendment passes the whole exception fixture, both legacy and PEP695 alias fixtures, semantic tests (515 passed, 35 ignored), canonical hooks, formatting and strict Clippy. The added finite class-or-tuple union assertion fails on submitted 918 and passes with this revision. Earlier 918 core, IDE and full Markdown results remain historical evidence; they are not a new full-suite claim for e752397.\n\nTamir approved the exact e752397 amendment for PR #30758; it is now the published head.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/acf15a39e2aa7b97ff7feda4fe94275447fa68ed"
        },
        {
          "label": "Qualified contribution",
          "url": "https://github.com/tamird/ruff/commit/9188597e94983c89c39c386cb6d8a1c603d6bad5"
        },
        {
          "label": "Native and all 532 default Markdown cases",
          "url": "https://app.buildbuddy.io/invocation/731e2166-7327-4bcb-b58b-ec72235f39d7"
        },
        {
          "label": "Proposed e752397 amendment: resolve the alias once",
          "url": "https://github.com/tamird/ruff/commit/e752397a71030a39868a43a682835508238e3afd"
        },
        {
          "label": "e752397 amendment: matched regression, exception/alias fixtures, semantic tests and style",
          "url": "https://app.buildbuddy.io/invocation/f85ed6ea-83fa-436d-9eba-468ac1c7c9ac"
        }
      ],
      "head": "e752397a71030a39868a43a682835508238e3afd",
      "settledReviews": [
        {
          "kind": "proposal",
          "head": "9188597e94983c89c39c386cb6d8a1c603d6bad5",
          "url": "https://github.com/tamird/ruff/commit/9188597e94983c89c39c386cb6d8a1c603d6bad5",
          "outcome": "approved",
          "summary": "Tamir approved this exact commit for upstream submission."
        },
        {
          "kind": "amendment",
          "head": "e752397a71030a39868a43a682835508238e3afd",
          "baseHead": "9188597e94983c89c39c386cb6d8a1c603d6bad5",
          "url": "https://github.com/tamird/ruff/commit/e752397a71030a39868a43a682835508238e3afd",
          "title": "Review the exception-alias revision for PR #30758",
          "summary": "Tamir approved the exact e752397 amendment for PR #30758; it is now the published head.",
          "body": "Review the amendment to PR #30758. The PR still publishes `9188597`; this proposed replacement is `e752397`. The earlier approval does not cover the amendment.\n\nAlex requested resolving the outer alias once before class, tuple, union and intersection handling. The added class-or-tuple union assertion fails on the published commit and passes on the amendment. Whole exception and both alias fixtures, semantic tests (515 passed, 35 ignored), hooks, formatting and strict Clippy pass. [Qualification](https://app.buildbuddy.io/invocation/f85ed6ea-83fa-436d-9eba-468ac1c7c9ac).\n\n## Changes from the submitted commit\n\nThis is Git’s actual range-diff of the two single-commit proposals on the same base. The pairing option matches the replacement commit with its predecessor.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 f31dd86f222f7d978a65cfc453eaf88f11456ed7..9188597e94983c89c39c386cb6d8a1c603d6bad5 f31dd86f222f7d978a65cfc453eaf88f11456ed7..e752397a71030a39868a43a682835508238e3afd\n```\n\n```diff\n1:  9188597e94 ! 1:  e752397a71 [ty] Resolve aliases of exception tuples\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Resolve aliases of exception tuples\n    +    [ty] Resolve exception-handler aliases\n     \n    -    An except handler annotated with an alias of a tuple of exception\n    -    classes inferred BaseException for its caught value, losing the tuple\n    -    element types. The structural handler inspected the alias wrapper\n    -    instead of the tuple it described.\n    +    Aliases of exception tuples and class-or-tuple unions could infer\n    +    BaseException for the caught value, losing the exception types described\n    +    by the alias.\n     \n    -    Resolve aliases when projecting the tuple specification. Keep the\n    -    original type for union and assignability handling so this projection\n    -    does not add recursive traversal through union aliases. Extend the\n    -    existing alias fixture with a plain tuple alias beside the narrowed one.\n    +    Resolve the outermost alias once before dispatching to the existing\n    +    tuple, class, union and intersection projections. Extend the existing\n    +    alias fixture with plain tuple and class-or-tuple union cases beside the\n    +    narrowed tuple.\n     \n      ## crates/ty_python_semantic/resources/mdtest/exception/basic.md ##\n    +@@ crates/ty_python_semantic/resources/mdtest/exception/basic.md: def catch(classes: tuple[type[ValueError], ...] | tuple[type[RuntimeError], ...]\n    +         reveal_type(exc)  # revealed: ValueError | RuntimeError\n    + ```\n    + \n    +-## Type alias for a narrowed tuple of exception classes\n    ++## Aliases for exception classes and tuples\n    + \n    +-The caught type comes from the tuple described by the alias.\n    ++The caught type comes from the exception classes and tuple elements described by the alias.\n    + \n    + ```toml\n    + [environment]\n     @@ crates/ty_python_semantic/resources/mdtest/exception/basic.md: python-version = \"3.12\"\n      ```py\n      from ty_extensions import AlwaysFalsy, Intersection, Not\n      \n     +type Errors = tuple[type[ValueError], ...]\n      type NonemptyErrors = Intersection[tuple[type[ValueError], ...], Not[AlwaysFalsy]]\n    ++type MixedErrors = type[ValueError] | tuple[type[RuntimeError], ...]\n      \n     -def catch(classes: NonemptyErrors):\n    -+def catch(classes: NonemptyErrors, plain: Errors):\n    ++def catch(classes: NonemptyErrors, plain: Errors, mixed: MixedErrors):\n          try:\n              help()\n          except classes as exc:\n    @@ crates/ty_python_semantic/resources/mdtest/exception/basic.md: python-version =\n     +        help()\n     +    except plain as exc:\n     +        reveal_type(exc)  # revealed: ValueError\n    ++\n    ++    try:\n    ++        help()\n    ++    except mixed as exc:\n    ++        reveal_type(exc)  # revealed: ValueError | RuntimeError\n      ```\n      \n      ## Negated dynamic type aliases\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                  )\n              };\n      \n    --        if let Some(tuple_spec) = ty.tuple_instance_spec(db, env) {\n    -+        if let Some(tuple_spec) = ty.resolve_type_alias(db).tuple_instance_spec(db, env) {\n    ++        let ty = ty.resolve_type_alias(db);\n    ++\n    +         if let Some(tuple_spec) = ty.tuple_instance_spec(db, env) {\n                  infer_from_tuple(&tuple_spec)\n              } else if ty.is_assignable_to(db, env, type_base_exception) {\n    -             // `except ValueError as e:`\n    +@@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n    +         ) {\n    +             // A tuple can retain its element types in a positive intersection member after\n    +             // narrowing, for example `tuple[type[ValueError], ...] & ~AlwaysFalsy`.\n    +-            let caught = ty\n    +-                .resolve_type_alias(db)\n    +-                .as_intersection()\n    +-                .and_then(|intersection| {\n    +-                    intersection.bounded_filter_map_positive(db, env, |member| {\n    +-                        infer_from_tuple(member.tuple_instance_spec(db, env)?.as_ref())\n    +-                    })\n    +-                });\n    ++            let caught = ty.as_intersection().and_then(|intersection| {\n    ++                intersection.bounded_filter_map_positive(db, env, |member| {\n    ++                    infer_from_tuple(member.tuple_instance_spec(db, env)?.as_ref())\n    ++                })\n    ++            });\n    +             Some(caught.unwrap_or_else(|| KnownClass::BaseException.to_instance(db, env)))\n    +         } else {\n    +             None\n```\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/e752397a71030a39868a43a682835508238e3afd). No PR-head update or maintainer reply has been posted.",
          "outcome": "approved"
        }
      ],
      "refinement": {
        "before": {
          "head": "9188597e94983c89c39c386cb6d8a1c603d6bad5"
        },
        "after": {
          "head": "e752397a71030a39868a43a682835508238e3afd"
        }
      }
    },
    {
      "id": "pr:30761",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 30761,
      "title": "[ty] Widen builtins with falsy fallbacks",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/30761",
      "summary": "The approved revision widens inferred or expressions with matching fallbacks. Explicit truthiness unions retain their precision.\n\nThe reduced pytest-autoprofile case and explicit-annotation controls pass on RBE. Native suites, all 532 mdtests, formatting and strict Clippy pass. The two conditional and tuple split probes still produce the invariant-list error.\n\nTamir approved 7b148056cd, now published on Ruff #30761.",
      "evidence": [
        {
          "label": "CodSpeed simple_script report on delivered head",
          "url": "https://github.com/astral-sh/ruff/pull/30761#issuecomment-7173586551"
        },
        {
          "label": "Eight matched simple_script rounds on the exact CI trees",
          "url": "https://app.buildbuddy.io/invocation/7d45838c-76ff-45ce-9cd9-2700ae8a1d5f"
        },
        {
          "label": "Checking the fallback literal earlier did not speed up simple_script",
          "url": "https://app.buildbuddy.io/invocation/921f8c70-7861-4c8d-9ce7-57b1a1054acf"
        },
        {
          "label": "Published inferred-or amendment",
          "url": "https://github.com/tamird/ruff/commit/7b148056cd81a79c3b67ce5afcfdcfba1e6f565a"
        },
        {
          "label": "Native suites and application, annotation, conditional and tuple controls",
          "url": "https://app.buildbuddy.io/invocation/617505e3-98eb-409a-a523-d5e68a065c2a"
        },
        {
          "label": "Alex’s review of the typeshed alternative",
          "url": "https://github.com/astral-sh/ruff/pull/30761#issuecomment-7167004660"
        },
        {
          "label": "Alex on consistency of public type forms",
          "url": "https://github.com/astral-sh/ruff/pull/30761#issuecomment-7167092595"
        },
        {
          "label": "Review notes for Alex’s feedback",
          "url": "https://github.com/tamird/sty/blob/main/docs/ruff-30761-review.md"
        },
        {
          "label": "RBE comparison of current stubs, stub-only change and published Ruff revision",
          "url": "https://app.buildbuddy.io/invocation/3a83c724-9a58-4307-89d3-e35cc8ea6063"
        },
        {
          "label": "Qualified three-type normalization commit",
          "url": "https://github.com/tamird/ruff/commit/142c9403b03b7e03d5559663823689da81cca214"
        },
        {
          "label": "All 532 fixtures with the complete three-file source tree",
          "url": "https://app.buildbuddy.io/invocation/ee240434-6ef4-4903-97f6-9bcf5497204b"
        },
        {
          "label": "Native suites and strict style",
          "url": "https://app.buildbuddy.io/invocation/52b055b4-21b5-4e81-b60c-75fb6c38f3d0"
        },
        {
          "label": "Matched published8a fallback controls",
          "url": "https://app.buildbuddy.io/invocation/c8d4ad79-c787-4c61-b380-076bcac0ca11"
        },
        {
          "label": "Approved and published 8a2c order-independent normalization commit",
          "url": "https://github.com/tamird/ruff/commit/8a2c814d3c7b236dee569aa55983ca2d06b84d0a"
        },
        {
          "label": "Published-head regression control, candidate whole fixture, native suites, all532 Markdown and strict style",
          "url": "https://app.buildbuddy.io/invocation/1670b6d4-8b0a-47e6-b460-35761f99e9b7"
        },
        {
          "label": "Carl’s insertion-order review request",
          "url": "https://github.com/astral-sh/ruff/pull/30761#discussion_r4672859828"
        },
        {
          "label": "Delivered 71295c conflict port",
          "url": "https://github.com/tamird/ruff/commit/71295c0e4f774078fbdd23c3c8636e5be92711d7"
        },
        {
          "label": "Current-base conflict-port qualification: native, 532 maintained Markdown and strict style",
          "url": "https://app.buildbuddy.io/invocation/f7becdd7-7793-4f88-9b8e-c1013a7cb1ce"
        },
        {
          "label": "Proposed edc8 complete replacement commit",
          "url": "https://github.com/tamird/ruff/commit/edc8e4990cd10109fadea84e15447438a7141a31"
        },
        {
          "label": "edc8: maintained532MD plus1temporary review fixture; core/semantic/IDE and strict style",
          "url": "https://app.buildbuddy.io/invocation/459a1ca0-d642-491d-970f-b35ccdbd261c"
        },
        {
          "label": "Carl: changes requested on submitted ce523",
          "url": "https://github.com/astral-sh/ruff/pull/30761#pullrequestreview-6013560748"
        },
        {
          "label": "Partial calls must retain receiver correlation",
          "url": "https://github.com/astral-sh/ruff/pull/30761#discussion_r4659214352"
        },
        {
          "label": "Property setters must retain individual accessor identity",
          "url": "https://github.com/astral-sh/ruff/pull/30761#discussion_r4659214358"
        },
        {
          "label": "Overload order can relate result and receiver",
          "url": "https://github.com/astral-sh/ruff/pull/30761#discussion_r4659214368"
        },
        {
          "label": "Separate receivers retain expansion behavior and budget",
          "url": "https://github.com/astral-sh/ruff/pull/30761#discussion_r4659214372"
        },
        {
          "label": "Narrow UnionBuilder empty-string reconstruction",
          "url": "https://github.com/astral-sh/ruff/pull/30761#discussion_r4659248502"
        },
        {
          "label": "Submitted ce523f7 commit",
          "url": "https://github.com/tamird/ruff/commit/ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e"
        },
        {
          "label": "ce523f7: six whole fixtures, semantic tests, hooks and strict style",
          "url": "https://app.buildbuddy.io/invocation/3108c385-3841-4250-868f-e9b9bac86188"
        },
        {
          "label": "New 61c71bb single commit for review",
          "url": "https://github.com/tamird/ruff/commit/61c71bb62410ceb55c45c0f6d223c437858e07c1"
        },
        {
          "label": "61c71bb: six existing fixtures, semantic tests, hooks and strict style checks",
          "url": "https://app.buildbuddy.io/invocation/b2334840-f593-40d3-85b7-c08feadc29e5"
        },
        {
          "label": "Earlier d367: Review the qualified commit",
          "url": "https://github.com/tamird/ruff/commit/d367097750ddf7a8cd0f1e23b543cd3a8208af56"
        },
        {
          "label": "Earlier d367: Guard-preserving fix: native and all 532 default Markdown cases",
          "url": "https://app.buildbuddy.io/invocation/5fd38933-656b-48ca-9496-4bb62970bd88"
        },
        {
          "label": "Earlier d367: Existing enum fixture and final canonical hooks",
          "url": "https://app.buildbuddy.io/invocation/68523e7a-4661-400e-9e87-cbf65205f4f2"
        },
        {
          "label": "Earlier d367: Current Dulwich and SymPy: unchanged diagnostics",
          "url": "https://app.buildbuddy.io/invocation/2ad7d8d4-5061-4c34-a4ea-64a11df3bb10"
        }
      ],
      "head": "7b148056cd81a79c3b67ce5afcfdcfba1e6f565a",
      "settledReviews": [
        {
          "kind": "proposal",
          "head": "ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e",
          "url": "https://github.com/tamird/ruff/commit/ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e",
          "outcome": "approved",
          "title": "Approved receiver-union revision: 61c71bb to ce523f7",
          "summary": "Tamir approved this exact commit under the conditional LGTM after the requested predicate and comment changes were verified and qualified.",
          "body": "The requested receiver-union changes are qualified and submitted as [Ruff #30761](https://github.com/astral-sh/ruff/pull/30761). The unsupported-overload predicate allows an empty set, and comments explain the remaining screening and reconstruction. Tamir’s conditional approval is satisfied; this is review history, not a new decision request.\n\n## Changes from the previous proposal\n\nGit’s actual range-diff pairs the two single-commit proposals on the same base.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 f31dd86f222f7d978a65cfc453eaf88f11456ed7..61c71bb62410ceb55c45c0f6d223c437858e07c1 f31dd86f222f7d978a65cfc453eaf88f11456ed7..ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e\n```\n\n```diff\n1:  61c71bb624 ! 1:  ce523f7be1 [ty] Unify receivers of one bound method\n    @@ crates/ty_python_semantic/src/types/method.rs: impl<'db> BoundMethodType<'db> {\n     +            }\n     +        }\n     +        let signatures = first.unbound_signatures_with_inferred_return_type(db)?;\n    -+        if signatures.overloads.is_empty()\n    -+            || !signatures\n    -+                .overloads\n    -+                .iter()\n    -+                .all(|signature| signature.supports_receiver_union(db, env))\n    ++        // Parameters, returns, or predicates that depend on one receiver need separate bindings.\n    ++        if signatures\n    ++            .overloads\n    ++            .iter()\n    ++            .any(|signature| !signature.supports_receiver_union(db, env))\n     +        {\n     +            return None;\n     +        }\n    ++        // The shared overload matcher needs the full receiver union to determine its return type.\n     +        let receiver = UnionType::from_elements(\n     +            db,\n     +            env,\n    @@ crates/ty_python_semantic/src/types/method.rs: impl<'db> BoundMethodType<'db> {\n     +                method.self_instance(db)\n     +            }),\n     +        );\n    ++        // The identity checks let the first method retain the shared function and program.\n     +        Some(first.map_self_type(db, |_receiver| receiver))\n     +    }\n     +\n```\n\n[Read the complete commit](https://github.com/tamird/ruff/commit/ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e)."
        },
        {
          "kind": "amendment",
          "status": "approved",
          "head": "edc8e4990cd10109fadea84e15447438a7141a31",
          "baseHead": "ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e",
          "url": "https://github.com/tamird/ruff/commit/edc8e4990cd10109fadea84e15447438a7141a31",
          "title": "Review the narrow string-union replacement for PR #30761",
          "summary": "Tamir approved exact edc8e499 as the string-union replacement for PR #30761.",
          "body": "Review replacing submitted `ce523f7` with `edc8e499` on PR #30761. This removes the receiver-merging approach and implements Carl’s requested UnionBuilder fix: `(str & ~AlwaysFalsy) | Literal[\"\"]` becomes `str`. Nonempty fallbacks, additional intersection constraints and literal-string precision retain their existing handling.\n\nFor ordinary `str` annotations that include subclasses with a false-returning `__bool__`, this deliberately widens the modeled type; it is not an exact runtime-class claim.\n\nQualification passes all 532 maintained Markdown fixtures plus one temporary reviewer-case fixture, core 86, semantic 515 (35 ignored), IDE 1964, canonical hooks, formatting and strict Clippy. The temporary examples are not committed; network-backed modes were not separately qualified. [Qualification](https://app.buildbuddy.io/invocation/459a1ca0-d642-491d-970f-b35ccdbd261c).\n\n## Replacement range-diff\n\nThe complete paired comparison follows. PR #30761 remains at the old head until this replacement is approved.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 f31dd86f222f7d978a65cfc453eaf88f11456ed7..ce523f7be15caa2f1dbcbdd16dfc1d64826fa47e f31dd86f222f7d978a65cfc453eaf88f11456ed7..edc8e4990cd10109fadea84e15447438a7141a31\n```\n\n```diff\n1:  ce523f7be1 ! 1:  edc8e4990c [ty] Unify receivers of one bound method\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Unify receivers of one bound method\n    +    [ty] Simplify strings with empty fallbacks\n     \n    -    A boolean fallback could produce a union of bound methods for the same\n    -    function. Selecting overloads separately for each receiver chose a\n    -    LiteralString-specific return for str.split, even when another receiver\n    -    required the ordinary list[str] result.\n    +    Normalize `(str & ~AlwaysFalsy) | Literal[\"\"]` to `str` in the union\n    +    builder. This lets methods on `s or \"\"` use their ordinary `str` overloads\n    +    without combining bound methods from different receivers.\n     \n    -    Combine receiver alternatives before overload selection when they refer\n    -    to the same instance method and its signatures have no receiver-dependent\n    -    correlations. Preserve independent bindings for class methods, generic\n    -    correlations and predicates. Keep the original callable union for\n    -    diagnostics and reject alternatives with no matching overload.\n    +    Match only the builtin `str` core with the single truthiness exclusion,\n    +    and handle both insertion orders through the existing union reductions.\n    +    Nonempty fallbacks retain their truthiness narrowing, and a literal empty\n    +    receiver still selects LiteralString-specific overloads.\n     \n    - ## crates/ty_python_semantic/resources/mdtest/call/overloads.md ##\n    -@@ crates/ty_python_semantic/resources/mdtest/call/overloads.md: def narrowed(color: Color):\n    -         return\n    -     reveal_type(color.label())  # revealed: int | str\n    - \n    --def explicit(color: Literal[Color.GREEN, Color.BLUE]):\n    -+def explicit(\n    -+    color: Literal[Color.GREEN, Color.BLUE],\n    -+    unsupported: Literal[Color.RED, Color.GREEN],\n    -+):\n    -     reveal_type(color.label())  # revealed: int | str\n    -+    unsupported.label()  # error: [no-matching-overload]\n    - ```\n    - \n    - ### Expanding PEP 695 type alias\n    +    This deliberately widens the broad `str` annotation for subclasses that\n    +    override `__bool__` to return false. Other intersection constraints and\n    +    subclass-specific cores retain their original unions.\n     \n      ## crates/ty_python_semantic/resources/mdtest/expression/boolean.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str):\n          reveal_type(False or False)  # revealed: Literal[False]\n          reveal_type(foo or False)  # revealed: (str & ~AlwaysFalsy) | Literal[False]\n          reveal_type(foo or True)  # revealed: (str & ~AlwaysFalsy) | Literal[True]\n    -+\n    -+    # Splitting str with an empty-string fallback still returns list[str].\n    ++    reveal_type(foo or \"\")  # revealed: str\n     +    reveal_type((foo or \"\").split())  # revealed: list[str]\n    ++    reveal_type(foo or \"fallback\")  # revealed: str & ~AlwaysFalsy\n     +\n     +# A literal receiver still selects the LiteralString overload.\n     +reveal_type(\"\".split())  # revealed: list[LiteralString]\n    @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str\n      \n      ## AND\n     \n    - ## crates/ty_python_semantic/src/types.rs ##\n    -@@ crates/ty_python_semantic/src/types.rs: impl<'db> Type<'db> {\n    -                 Binding::single(self, Signature::dynamic(self)).into()\n    -             }\n    + ## crates/ty_python_semantic/resources/mdtest/narrow/len.md ##\n    +@@ crates/ty_python_semantic/resources/mdtest/narrow/len.md: def _(x: Literal[\"foo\", \"\"] | list[int]):\n    +         reveal_type(x)  # revealed: Literal[\"\"] | list[int]\n    + ```\n      \n    --            // Note that this correctly returns `None` if none of the union elements are callable.\n    --            Type::Union(union) => Bindings::from_union(\n    --                self,\n    --                union.elements(db).iter().map(|element| {\n    --                    element.bindings_with_receiver(db, env, recursion_guard, receiver)\n    --                }),\n    --            ),\n    -+            // Select one function's overloads against all of its possible receivers together.\n    -+            Type::Union(union) => {\n    -+                if let Some(method) = BoundMethodType::from_receiver_union(db, env, union) {\n    -+                    return Type::BoundMethod(method)\n    -+                        .bindings_with_receiver(db, env, recursion_guard, receiver)\n    -+                        .with_callable_type(self);\n    -+                }\n    -+                Bindings::from_union(\n    -+                    self,\n    -+                    union.elements(db).iter().map(|element| {\n    -+                        element.bindings_with_receiver(db, env, recursion_guard, receiver)\n    -+                    }),\n    -+                )\n    -+            }\n    +-## Narrowing away empty literals\n    ++## An empty fallback restores `str`\n      \n    -             // A narrowed `type[T: Base] & type[Child]` still needs to construct `T & Child`,\n    -             // but its constructor must come from `Child`, not from `Base` as an independent,\n    +-This pattern is common when a prior truthiness check narrows a type, and then a conditional\n    +-expression adds an empty literal back:\n    ++A truthiness check narrows a string, but adding an empty string back restores broad `str`, in either\n    ++branch order. A later length check leaves that type unchanged:\n    + \n    + ```py\n    + def _(lines: list[str]):\n    +@@ crates/ty_python_semantic/resources/mdtest/narrow/len.md: def _(lines: list[str]):\n    + \n    +         reveal_type(line)  # revealed: str & ~AlwaysFalsy\n    +         value = line if len(line) < 3 else \"\"\n    +-        reveal_type(value)  # revealed: (str & ~AlwaysFalsy) | Literal[\"\"]\n    ++        reveal_type(value)  # revealed: str\n    ++        value = \"\" if len(line) < 3 else line\n    ++        reveal_type(value)  # revealed: str\n    + \n    +         if len(value):\n    +-            # `Literal[\"\"]` is removed, `str & ~AlwaysFalsy` is unchanged\n    +-            reveal_type(value)  # revealed: str & ~AlwaysFalsy\n    +-            # Accessing value[0] is safe here\n    ++            reveal_type(value)  # revealed: str\n    +             _ = value[0]\n    + ```\n     \n    - ## crates/ty_python_semantic/src/types/method.rs ##\n    -@@ crates/ty_python_semantic/src/types/method.rs: impl<'db> BoundMethodType<'db> {\n    -         )\n    -     }\n    + ## crates/ty_python_semantic/src/types/set_theoretic/builder.rs ##\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Itertools;\n    + use rustc_hash::FxHashSet;\n    + use smallvec::SmallVec;\n      \n    -+    /// Combine receivers of the same instance method before choosing its overloads.\n    -+    ///\n    -+    /// Signatures that depend on individual receivers must still be bound separately.\n    -+    pub(super) fn from_receiver_union(\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+        union: UnionType<'db>,\n    -+    ) -> Option<Self> {\n    -+        let (first, remaining) = union.elements(db).split_first()?;\n    -+        let Type::BoundMethod(first) = *first else {\n    -+            return None;\n    -+        };\n    -+        let function = first.func(db);\n    -+        let Type::FunctionLiteral(_) = function else {\n    -+            return None;\n    -+        };\n    -+        // Class methods capture a class object but substitute its instance type for `Self`.\n    -+        // They cannot use the single instance-receiver union constructed below.\n    -+        if first.class_method(db) {\n    -+            return None;\n    -+        }\n    -+        // A constrained receiver checks one alternative while retaining the original `__self__`.\n    -+        // Combining it with other receivers would lose that alternative's constraint.\n    -+        if first.self_instance(db) != first.signature_receiver(db) {\n    -+            return None;\n    -+        }\n    -+\n    -+        let program = first.program(db);\n    -+        for element in remaining {\n    -+            let Type::BoundMethod(method) = element else {\n    -+                return None;\n    -+            };\n    -+            // Binding only the first method must not discard another function's overloads or\n    -+            // class specialization, or use signatures from a different program.\n    -+            if method.func(db) != function || method.program(db) != program {\n    -+                return None;\n    -+            }\n    -+            if method.class_method(db) {\n    -+                return None;\n    -+            }\n    -+            if method.self_instance(db) != method.signature_receiver(db) {\n    -+                return None;\n    -+            }\n    -+        }\n    -+        let signatures = first.unbound_signatures_with_inferred_return_type(db)?;\n    -+        // Parameters, returns, or predicates that depend on one receiver need separate bindings.\n    -+        if signatures\n    -+            .overloads\n    ++fn is_exact_truthy_str<'db>(db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>) -> bool {\n    ++    let Type::Intersection(intersection) = ty else {\n    ++        return false;\n    ++    };\n    ++    intersection\n    ++        .positive(db)\n    ++        .iter()\n    ++        .copied()\n    ++        .eq([KnownClass::Str.to_instance(db, env)])\n    ++        && intersection\n    ++            .negative(db)\n     +            .iter()\n    -+            .any(|signature| !signature.supports_receiver_union(db, env))\n    ++            .copied()\n    ++            .eq([Type::AlwaysFalsy])\n    ++}\n    ++\n    + /// Extract `(core, guard)` from truthiness-guarded intersections.\n    + ///\n    + /// e.g.\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionElement<'db> {\n    +             return ReduceResult::KeepIf(true);\n    +         }\n    + \n    ++        // Treat an empty-string fallback as broad `str`, while keeping truthiness\n    ++        // narrowing for nonempty fallbacks and intersections with other constraints.\n    ++        if let UnionElement::StringLiterals(literals) = self\n    ++            && is_exact_truthy_str(db, env, other_type)\n    ++            && literals.keys().any(|literal| literal.value(db).is_empty())\n     +        {\n    -+            return None;\n    ++            return ReduceResult::Merged(KnownClass::Str.to_instance(db, env));\n     +        }\n    -+        // The shared overload matcher needs the full receiver union to determine its return type.\n    -+        let receiver = UnionType::from_elements(\n    -+            db,\n    -+            env,\n    -+            union.elements(db).iter().map(|element| {\n    -+                let Type::BoundMethod(method) = element else {\n    -+                    unreachable!(\"all union elements are bound methods\");\n    -+                };\n    -+                method.self_instance(db)\n    -+            }),\n    -+        );\n    -+        // The identity checks let the first method retain the shared function and program.\n    -+        Some(first.map_self_type(db, |_receiver| receiver))\n    -+    }\n     +\n    -     pub(super) fn apply_type_mapping_impl(\n    -         self,\n    -         db: &'db dyn Db,\n    -\n    - ## crates/ty_python_semantic/src/types/signatures.rs ##\n    -@@ crates/ty_python_semantic/src/types/signatures.rs: impl<'db> Signature<'db> {\n    -         self.receiver_constraints().is_none() && !self.is_paramspec_value()\n    +         let mut other_type_negated_cache = None;\n    + \n    +         let mut collapse = false;\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: enum ReduceResult<'db> {\n    +     /// The given `Type` can stand-in for the entire `UnionElement` for further union\n    +     /// simplification checks.\n    +     Type(Type<'db>),\n    ++    /// Replace both this element and the incoming type, reconsidering earlier elements.\n    ++    Merged(Type<'db>),\n    + }\n    + \n    + /// If the value ​​is defined recursively, widening is performed from fewer literal elements,\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    +                                 UnionElement::Type(existing)\n    +                                     if can_compare_with_literals(*existing) =>\n    +                                 {\n    ++                                    if string_literal.value(db).is_empty()\n    ++                                        && is_exact_truthy_str(db, &self.env, *existing)\n    ++                                    {\n    ++                                        self.elements.swap_remove(index);\n    ++                                        self.add_in_place_impl(\n    ++                                            KnownClass::Str.to_instance(db, &self.env),\n    ++                                            seen_aliases,\n    ++                                        );\n    ++                                        return;\n    ++                                    }\n    +                                     // e.g. `existing` could be `Literal[\"\"] & Any`,\n    +                                     // and `ty` could be `Literal[\"\"]`\n    +                                     if ty.is_redundant_with(db, &self.env, *existing) {\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    +         }\n          }\n      \n    -+    /// Whether all receiver alternatives can be checked against one signature.\n    -+    pub(super) fn supports_receiver_union(\n    -+        &self,\n    -+        db: &'db dyn Db,\n    -+        env: &ProgramEnvironment<'db>,\n    -+    ) -> bool {\n    -+        let Some((receiver, parameters)) = self.parameters.as_slice().split_first() else {\n    -+            return false;\n    -+        };\n    -+        if !self.supports_overload_aggregation() {\n    -+            return false;\n    -+        }\n    -+        if !receiver.is_positional() {\n    -+            return false;\n    -+        }\n    -+        // `Self` in another parameter or the return type relates that type to one receiver.\n    -+        if self.needs_self_mapping(db, env, parameters) {\n    -+            return false;\n    -+        }\n    -+        // Predicate results narrow an argument; retain the receiver that established that narrowing.\n    -+        if super::visitor::any_over_type_expanding_aliases(db, env, self.return_ty, |ty| {\n    -+            matches!(ty, Type::TypeIs(_) | Type::TypeGuard(_))\n    -+        }) {\n    -+            return false;\n    ++    fn reinsert_merged_type(\n    ++        &mut self,\n    ++        merged: Type<'db>,\n    ++        to_remove: SmallVec<[usize; 2]>,\n    ++        seen_aliases: &mut Vec<Type<'db>>,\n    ++    ) {\n    ++        for index in to_remove.into_iter().rev() {\n    ++            self.elements.swap_remove(index);\n     +        }\n    -+        // Other type parameters can correlate the receiver with arguments or the result.\n    -+        // A sole implicit `Self` is safe only when no other type depends on it.\n    -+        self.is_non_generic() || self.with_unused_self_upper_bound(db, env).is_some()\n    ++        // A merged type may subsume elements visited before the pair that produced it.\n    ++        self.add_in_place_impl(merged, seen_aliases);\n     +    }\n     +\n    -     /// Restrict the base signature to positional calls for parameters whose keyword name\n    -     /// is lost in every overriding overload. This comparison-only signature may contain\n    -     /// a positional-only parameter after a positional-or-keyword parameter so that we\n    +     fn push_type(&mut self, ty: Type<'db>, seen_aliases: &mut Vec<Type<'db>>) {\n    +         let db = self.db;\n    +         let mut ty = ty;\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    +                     }\n    +                     continue;\n    +                 }\n    ++                ReduceResult::Merged(merged) => {\n    ++                    to_remove.push(i);\n    ++                    self.reinsert_merged_type(merged, to_remove, seen_aliases);\n    ++                    return;\n    ++                }\n    +                 ReduceResult::Type(ty) => ty,\n    +                 ReduceResult::CollapseToObject => {\n    +                     self.collapse_to_object();\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    +                     ty = merged_type;\n    +                     continue;\n    +                 }\n    +-                for index in to_remove.into_iter().rev() {\n    +-                    self.elements.swap_remove(index);\n    +-                }\n    +-                // The merged type can also subsume earlier elements, such as `bool` when\n    +-                // the truthy and falsy parts of `int` merge.\n    +-                self.add_in_place_impl(merged_type, seen_aliases);\n    ++                self.reinsert_merged_type(merged_type, to_remove, seen_aliases);\n    +                 return;\n    +             }\n    + \n```\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/edc8e4990cd10109fadea84e15447438a7141a31).",
          "outcome": "approved"
        },
        {
          "kind": "amendment",
          "head": "71295c0e4f774078fbdd23c3c8636e5be92711d7",
          "baseHead": "edc8e4990cd10109fadea84e15447438a7141a31",
          "url": "https://github.com/tamird/ruff/commit/71295c0e4f774078fbdd23c3c8636e5be92711d7",
          "postedURL": "https://github.com/astral-sh/ruff/pull/30761",
          "title": "Delivered conflict port of the approved string normalization",
          "summary": "Delivered the required behavior-preserving conflict port of the edc8 contribution under its existing approval; Tamir’s exact approval remains recorded on edc8.",
          "body": "PR #30761 now publishes `71295c0e`, a required conflict port of approved `edc8e499` to upstream `493fe0d`. The exact string predicate, both insertion rules and maintained Markdown assertions are unchanged. The port commits upstream pending literal filters and removals before reinserting the merged type. This is authorized delivery of the approved contribution, not a new exact-head user approval.\n\nCurrent-base qualification passes core 86, semantic 541 (35 ignored), IDE 1964, all 532 maintained default Markdown fixtures plus the temporary review fixture, canonical hooks, formatting and strict Clippy. [Qualification](https://app.buildbuddy.io/invocation/f7becdd7-7793-4f88-9b8e-c1013a7cb1ce).\n\n## Changes from the approved contribution\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 f31dd86f222f7d978a65cfc453eaf88f11456ed7..edc8e4990cd10109fadea84e15447438a7141a31 493fe0d6639f7e437e01814718ef094373a1bab3..71295c0e4f774078fbdd23c3c8636e5be92711d7\n```\n\n```diff\n1:  edc8e4990c ! 1:  71295c0e4f [ty] Simplify strings with empty fallbacks\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n     +            .eq([Type::AlwaysFalsy])\n     +}\n     +\n    - /// Extract `(core, guard)` from truthiness-guarded intersections.\n    - ///\n    - /// e.g.\n    + /// The truthiness excluded by a single guard, e.g. `AlwaysFalsy` in `A & ~AlwaysFalsy`.\n    + /// Intersections that exclude both truthy and falsy values have no single guard.\n    + fn excluded_truthiness<'db>(db: &'db dyn Db, ty: Type<'db>) -> Option<Type<'db>> {\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionElement<'db> {\n                  return ReduceResult::KeepIf(true);\n              }\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionEle\n     +            return ReduceResult::Merged(KnownClass::Str.to_instance(db, env));\n     +        }\n     +\n    -         let mut other_type_negated_cache = None;\n    - \n    -         let mut collapse = false;\n    +         match self {\n    +             UnionElement::IntLiterals(literals) => {\n    +                 Self::reduce_literals(db, env, other_type, LiteralKind::Int, literals)\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: enum ReduceResult<'db> {\n          /// The given `Type` can stand-in for the entire `UnionElement` for further union\n          /// simplification checks.\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: enum ReduceResult<\n     +    Merged(Type<'db>),\n      }\n      \n    - /// If the value ​​is defined recursively, widening is performed from fewer literal elements,\n    + /// Removals to apply if the incoming type is added to the union or merged with an\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n                                      UnionElement::Type(existing)\n                                          if can_compare_with_literals(*existing) =>\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBui\n     +                                        );\n     +                                        return;\n     +                                    }\n    -                                     // e.g. `existing` could be `Literal[\"\"] & Any`,\n    -                                     // and `ty` could be `Literal[\"\"]`\n    -                                     if ty.is_redundant_with(db, &self.env, *existing) {\n    +                                     // Neither a string literal nor its complement is a subtype of\n    +                                     // `type[C]`. The reverse check still matters when the callable\n    +                                     // used as C's metaclass returns `Never`.\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n              }\n          }\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBui\n     +    fn reinsert_merged_type(\n     +        &mut self,\n     +        merged: Type<'db>,\n    -+        to_remove: SmallVec<[usize; 2]>,\n    ++        reductions: UnionReductions,\n     +        seen_aliases: &mut Vec<Type<'db>>,\n     +    ) {\n    -+        for index in to_remove.into_iter().rev() {\n    -+            self.elements.swap_remove(index);\n    -+        }\n    ++        reductions.apply(&mut self.elements, None);\n     +        // A merged type may subsume elements visited before the pair that produced it.\n     +        self.add_in_place_impl(merged, seen_aliases);\n     +    }\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBui\n              let db = self.db;\n              let mut ty = ty;\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    -                     }\n    +                     reductions.literal_filters.push((i, keep));\n                          continue;\n                      }\n     +                ReduceResult::Merged(merged) => {\n    -+                    to_remove.push(i);\n    -+                    self.reinsert_merged_type(merged, to_remove, seen_aliases);\n    ++                    reductions.to_remove.push(i);\n    ++                    self.reinsert_merged_type(merged, reductions, seen_aliases);\n     +                    return;\n     +                }\n                      ReduceResult::Type(ty) => ty,\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBui\n                          ty = merged_type;\n                          continue;\n                      }\n    --                for index in to_remove.into_iter().rev() {\n    --                    self.elements.swap_remove(index);\n    --                }\n    +-                reductions.apply(&mut self.elements, None);\n     -                // The merged type can also subsume earlier elements, such as `bool` when\n     -                // the truthy and falsy parts of `int` merge.\n     -                self.add_in_place_impl(merged_type, seen_aliases);\n    -+                self.reinsert_merged_type(merged_type, to_remove, seen_aliases);\n    ++                self.reinsert_merged_type(merged_type, reductions, seen_aliases);\n                      return;\n                  }\n      \n```\n\n[Read the delivered commit](https://github.com/tamird/ruff/commit/71295c0e4f774078fbdd23c3c8636e5be92711d7).",
          "outcome": "posted"
        },
        {
          "kind": "amendment",
          "status": "approved",
          "head": "8a2c814d3c7b236dee569aa55983ca2d06b84d0a",
          "baseHead": "71295c0e4f774078fbdd23c3c8636e5be92711d7",
          "url": "https://github.com/tamird/ruff/commit/8a2c814d3c7b236dee569aa55983ca2d06b84d0a",
          "title": "Review the order-independent string-normalization amendment",
          "summary": "Tamir approved exact 8a2c814d for PR #30761; this order-independent normalization is now the published head.",
          "body": "PR #30761 still publishes `71295c0e`. This proposed amendment is `8a2c814d`; it needs Tamir approval before the PR is updated.\n\nWith a third `LiteralString` member, the published normalization depended on insertion order: one tuple order accepted a `list[str]` assignment and the other rejected it. The revision checks empty-string coverage once after union insertion, including `LiteralString`, then rebuilds through the existing normalizer. It removes both insertion-time checks and the special merge/reinsertion path.\n\nThe rule still requires builtin `str` with only the falsy exclusion. Nonempty fallbacks, additional intersection constraints and subclass-specific cores keep their handling; literal empty receivers retain their LiteralString-specific overloads.\n\nThe reported cases fail on published 71295c and pass on the revision. The whole Boolean fixture, core 86, semantic 541 (35 ignored), IDE 1964, all 532 default Markdown fixtures and strict style checks pass. [Qualification](https://app.buildbuddy.io/invocation/1670b6d4-8b0a-47e6-b460-35761f99e9b7).\n\n## Changes from the published commit\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 493fe0d6639f7e437e01814718ef094373a1bab3..71295c0e4f774078fbdd23c3c8636e5be92711d7 493fe0d6639f7e437e01814718ef094373a1bab3..8a2c814d3c7b236dee569aa55983ca2d06b84d0a\n```\n\n```diff\n1:  71295c0e4f ! 1:  8a2c814d3c [ty] Simplify strings with empty fallbacks\n    @@ Metadata\n      ## Commit message ##\n         [ty] Simplify strings with empty fallbacks\n     \n    -    Normalize `(str & ~AlwaysFalsy) | Literal[\"\"]` to `str` in the union\n    -    builder. This lets methods on `s or \"\"` use their ordinary `str` overloads\n    -    without combining bound methods from different receivers.\n    +    Normalize unions of `str & ~AlwaysFalsy` with either `Literal[\"\"]` or\n    +    `LiteralString` to `str`. This lets methods on string fallback expressions\n    +    use ordinary `str` overloads. A literal empty-string receiver still selects\n    +    LiteralString-specific overloads.\n     \n    -    Match only the builtin `str` core with the single truthiness exclusion,\n    -    and handle both insertion orders through the existing union reductions.\n    -    Nonempty fallbacks retain their truthiness narrowing, and a literal empty\n    -    receiver still selects LiteralString-specific overloads.\n    +    Collect empty-string coverage after union insertion, alongside covered\n    +    literal exclusions. `LiteralString` includes the empty string and can\n    +    subsume an explicit empty-string member while the union is constructed.\n     \n    -    This deliberately widens the broad `str` annotation for subclasses that\n    -    override `__bool__` to return false. Other intersection constraints and\n    -    subclass-specific cores retain their original unions.\n    +    Match only the builtin `str` core with the single truthiness exclusion.\n    +    Nonempty fallbacks, other intersection constraints and subclass-specific\n    +    cores retain their original handling. This deliberately widens the broad\n    +    `str` annotation for subclasses that override `__bool__` to return false.\n     \n      ## crates/ty_python_semantic/resources/mdtest/expression/boolean.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str):\n    @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str\n     +\n     +# A literal receiver still selects the LiteralString overload.\n     +reveal_type(\"\".split())  # revealed: list[LiteralString]\n    ++\n    ++from typing import LiteralString\n    ++\n    ++def _(s: str, t: LiteralString, i: int):\n    ++    reveal_type(s or t)  # revealed: str\n    ++    if s:\n    ++        a: list[str] = (s, t, \"\")[i].split()  # ok\n    ++        b: list[str] = (t, s, \"\")[i].split()  # ok\n      ```\n      \n      ## AND\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n      /// The truthiness excluded by a single guard, e.g. `AlwaysFalsy` in `A & ~AlwaysFalsy`.\n      /// Intersections that exclude both truthy and falsy values have no single guard.\n      fn excluded_truthiness<'db>(db: &'db dyn Db, ty: Type<'db>) -> Option<Type<'db>> {\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionElement<'db> {\n    -             return ReduceResult::KeepIf(true);\n    -         }\n    - \n    -+        // Treat an empty-string fallback as broad `str`, while keeping truthiness\n    -+        // narrowing for nonempty fallbacks and intersections with other constraints.\n    -+        if let UnionElement::StringLiterals(literals) = self\n    -+            && is_exact_truthy_str(db, env, other_type)\n    -+            && literals.keys().any(|literal| literal.value(db).is_empty())\n    -+        {\n    -+            return ReduceResult::Merged(KnownClass::Str.to_instance(db, env));\n    -+        }\n    -+\n    -         match self {\n    -             UnionElement::IntLiterals(literals) => {\n    -                 Self::reduce_literals(db, env, other_type, LiteralKind::Int, literals)\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: enum ReduceResult<'db> {\n    -     /// The given `Type` can stand-in for the entire `UnionElement` for further union\n    -     /// simplification checks.\n    -     Type(Type<'db>),\n    -+    /// Replace both this element and the incoming type, reconsidering earlier elements.\n    -+    Merged(Type<'db>),\n    - }\n    - \n    - /// Removals to apply if the incoming type is added to the union or merged with an\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    -                                 UnionElement::Type(existing)\n    -                                     if can_compare_with_literals(*existing) =>\n    -                                 {\n    -+                                    if string_literal.value(db).is_empty()\n    -+                                        && is_exact_truthy_str(db, &self.env, *existing)\n    -+                                    {\n    -+                                        self.elements.swap_remove(index);\n    -+                                        self.add_in_place_impl(\n    -+                                            KnownClass::Str.to_instance(db, &self.env),\n    -+                                            seen_aliases,\n    -+                                        );\n    -+                                        return;\n    -+                                    }\n    -                                     // Neither a string literal nor its complement is a subtype of\n    -                                     // `type[C]`. The reverse check still matters when the callable\n    -                                     // used as C's metaclass returns `Never`.\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    -         }\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n    +     if literals.is_empty() {\n    +         return false;\n          }\n    ++    // LiteralString can subsume an explicit empty-string member during insertion.\n    ++    let covers_empty_string = literals.iter().any(|literal| match literal {\n    ++        LiteralValueTypeKind::LiteralString => true,\n    ++        LiteralValueTypeKind::String(literal) => literal.value(db).is_empty(),\n    ++        _ => false,\n    ++    });\n      \n    -+    fn reinsert_merged_type(\n    -+        &mut self,\n    -+        merged: Type<'db>,\n    -+        reductions: UnionReductions,\n    -+        seen_aliases: &mut Vec<Type<'db>>,\n    -+    ) {\n    -+        reductions.apply(&mut self.elements, None);\n    -+        // A merged type may subsume elements visited before the pair that produced it.\n    -+        self.add_in_place_impl(merged, seen_aliases);\n    -+    }\n    -+\n    -     fn push_type(&mut self, ty: Type<'db>, seen_aliases: &mut Vec<Type<'db>>) {\n    -         let db = self.db;\n    -         let mut ty = ty;\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    -                     reductions.literal_filters.push((i, keep));\n    -                     continue;\n    -                 }\n    -+                ReduceResult::Merged(merged) => {\n    -+                    reductions.to_remove.push(i);\n    -+                    self.reinsert_merged_type(merged, reductions, seen_aliases);\n    -+                    return;\n    -+                }\n    -                 ReduceResult::Type(ty) => ty,\n    -                 ReduceResult::CollapseToObject => {\n    -                     self.collapse_to_object();\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: impl<'db> UnionBuilder<'db> {\n    -                     ty = merged_type;\n    -                     continue;\n    -                 }\n    --                reductions.apply(&mut self.elements, None);\n    --                // The merged type can also subsume earlier elements, such as `bool` when\n    --                // the truthy and falsy parts of `int` merge.\n    --                self.add_in_place_impl(merged_type, seen_aliases);\n    -+                self.reinsert_merged_type(merged_type, reductions, seen_aliases);\n    -                 return;\n    -             }\n    - \n    +     let mut changed = false;\n    +     for ty in types {\n    +         if !unpack_aliases && any_over_type(db, env, *ty, false, Type::is_alias_like) {\n    +             continue;\n    +         }\n    ++        if covers_empty_string && is_exact_truthy_str(db, env, *ty) {\n    ++            *ty = KnownClass::Str.to_instance(db, env);\n    ++            changed = true;\n    ++            continue;\n    ++        }\n    +         if let Some(widened) = remove_covered_exclusions(db, env, *ty, |excluded| {\n    +             excluded\n    +                 .as_literal_value_kind()\n```\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/8a2c814d3c7b236dee569aa55983ca2d06b84d0a).",
          "outcome": "approved"
        },
        {
          "kind": "scope",
          "status": "approved",
          "head": "8a2c814d3c7b236dee569aa55983ca2d06b84d0a",
          "url": "https://github.com/astral-sh/ruff/pull/30761",
          "title": "Authorize preparing str/bytes/int normalization",
          "summary": "Tamir authorized preparation and Bazel/RBE qualification of the str/bytes/int revision. Publication of its qualified source requires separate approval.",
          "body": "Authorize preparing and qualifying a revision of PR #30761 covering `str`, `bytes`, and `int` together? The published string-only head remains `8a2c814d3c7b236dee569aa55983ca2d06b84d0a`. No broader source has been prepared or qualified.\n\nRecommendation: use the existing post-insertion normalization for these matching builtin fallbacks:\n\n| Union | Proposed result |\n|---|---|\n| `(str & ~AlwaysFalsy) \\| Literal[\"\"]` | `str` |\n| `(bytes & ~AlwaysFalsy) \\| Literal[b\"\"]` | `bytes` |\n| `(int & ~AlwaysFalsy) \\| Literal[0]` | `int` |\n\nRetain `LiteralString` as empty-string coverage. Match only a single builtin core with the sole `~AlwaysFalsy` exclusion. Preserve extra constraints, subclass-specific cores, alias and cycle safeguards, and nonempty/nonzero fallback precision. Keep `False` distinct from integer zero; a `False`-only fallback does not trigger integer widening. Existing boolean normalization needs no separate extension.\n\nThis is deliberate widening, not type equivalence. Broad results admit falsy subclass and enum values and lose some later narrowing. Broad `int` also admits `False` and zero-valued `IntEnum` members. The global union normalizer affects explicitly written intersection annotations as well as inferred expressions.\n\n[Carl supports weighing this precision tradeoff and agrees that bytes and integers should be considered together](https://github.com/astral-sh/ruff/pull/30761#issuecomment-7140743217). [Alex identifies lost enum narrowing and requests the same consistency](https://github.com/astral-sh/ruff/pull/30761#issuecomment-7133051265). The demonstrated split-overload benefit is specific to strings; bytes and integers extend consistency. Both independent technical assessments support this bounded plan.\n\nIf authorized, extend the existing Boolean OR fixture for bytes/int empty-or-zero fallbacks and nonempty/nonzero controls, reuse existing order and truthiness coverage, and qualify through Bazel/RBE. Present the qualified commit and actual range-diff for separate approval before updating the PR.\n\nThis decision authorizes preparation and qualification only. It does not approve source publication, a reply, closure, or merge. The separate #30898 amendment `88b15ebe` remains pending and unchanged.\n",
          "outcome": "approved",
          "approvedAt": "2026-11-25T12:41:14.101073Z"
        },
        {
          "kind": "amendment",
          "status": "approved",
          "head": "142c9403b03b7e03d5559663823689da81cca214",
          "baseHead": "8a2c814d3c7b236dee569aa55983ca2d06b84d0a",
          "url": "https://github.com/tamird/ruff/commit/142c9403b03b7e03d5559663823689da81cca214",
          "title": "Review str/bytes/int normalization amendment",
          "summary": "Approve updating PR #30761 from published 8a2c814d to qualified 142c9403. The earlier scope authorization is retained separately.",
          "body": "Review the replacement for PR #30761: published `8a2c814d` → proposed `142c9403`. Both single-commit revisions use upstream `493fe0d6639f7e437e01814718ef094373a1bab3` as their base.\n\nThe shared post-insertion pass now widens matching `str`, `bytes`, and `int` fallbacks. It retains `LiteralString` coverage and extra constraints; a `False`-only fallback does not trigger integer widening. The existing OR fixture adds five assertions for bytes/int fallbacks and their negative controls.\n\nThis deliberate widening also applies to written intersection annotations. The broad results admit falsy subclass values; `int` additionally admits `False` and zero-valued `IntEnum` members. Your authorization to prepare and qualify this scope is recorded separately from this source decision.\n\nThe two new positive fallback assertions fail on published `8a2c814d`. The final source passes core 86, semantic 541 (35 ignored), IDE 1,964, all 532 Markdown fixtures, formatting, canonical hooks and strict Clippy on RBE. [Matched controls](https://app.buildbuddy.io/invocation/c8d4ad79-c787-4c61-b380-076bcac0ca11), [native and strict style](https://app.buildbuddy.io/invocation/52b055b4-21b5-4e81-b60c-75fb6c38f3d0), [complete three-file Markdown qualification](https://app.buildbuddy.io/invocation/ee240434-6ef4-4903-97f6-9bcf5497204b).\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/142c9403b03b7e03d5559663823689da81cca214). Updating #30761 requires approval of this source; replies, closure and merge remain held.\n\n## Changes from the submitted commit\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 493fe0d6639f7e437e01814718ef094373a1bab3..8a2c814d3c7b236dee569aa55983ca2d06b84d0a 493fe0d6639f7e437e01814718ef094373a1bab3..142c9403b03b7e03d5559663823689da81cca214\n```\n\n```diff\n1:  8a2c814d3c ! 1:  142c9403b0 [ty] Simplify strings with empty fallbacks\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Simplify strings with empty fallbacks\n    +    [ty] Widen builtins with falsy fallbacks\n     \n    -    Normalize unions of `str & ~AlwaysFalsy` with either `Literal[\"\"]` or\n    -    `LiteralString` to `str`. This lets methods on string fallback expressions\n    -    use ordinary `str` overloads. A literal empty-string receiver still selects\n    -    LiteralString-specific overloads.\n    +    Normalize unions of T & ~AlwaysFalsy with a matching fallback to T for\n    +    builtin str, bytes and int. Match \"\" or LiteralString for str, b\"\" for\n    +    bytes, and integer 0 for int. String fallback expressions can then use\n    +    ordinary str overloads.\n     \n    -    Collect empty-string coverage after union insertion, alongside covered\n    -    literal exclusions. `LiteralString` includes the empty string and can\n    -    subsume an explicit empty-string member while the union is constructed.\n    +    Collect these witnesses after union insertion, alongside covered literal\n    +    exclusions, so normalization does not depend on insertion order.\n    +    LiteralString may have absorbed an explicit empty-string member.\n     \n    -    Match only the builtin `str` core with the single truthiness exclusion.\n    -    Nonempty fallbacks, other intersection constraints and subclass-specific\n    -    cores retain their original handling. This deliberately widens the broad\n    -    `str` annotation for subclasses that override `__bool__` to return false.\n    +    Apply the rule globally, including unions written in annotations. The\n    +    widened builtin types include falsy subclass values. A widened int also\n    +    admits False and IntEnum members whose value is zero. Using False as the\n    +    fallback does not trigger the integer rule. Additional intersection\n    +    constraints, subclass cores and enum cores retain their original\n    +    handling.\n     \n      ## crates/ty_python_semantic/resources/mdtest/expression/boolean.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str):\n    @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str\n     +    reveal_type((foo or \"\").split())  # revealed: list[str]\n     +    reveal_type(foo or \"fallback\")  # revealed: str & ~AlwaysFalsy\n     +\n    ++def _(data: bytes, number: int):\n    ++    reveal_type(data or b\"\")  # revealed: bytes\n    ++    reveal_type(data or b\"fallback\")  # revealed: bytes & ~AlwaysFalsy\n    ++    reveal_type(number or 0)  # revealed: int\n    ++    reveal_type(number or 1)  # revealed: int & ~AlwaysFalsy\n    ++    reveal_type(number or False)  # revealed: (int & ~AlwaysFalsy) | Literal[False]\n    ++\n     +# A literal receiver still selects the LiteralString overload.\n     +reveal_type(\"\".split())  # revealed: list[LiteralString]\n     +\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n      use rustc_hash::FxHashSet;\n      use smallvec::SmallVec;\n      \n    -+fn is_exact_truthy_str<'db>(db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>) -> bool {\n    ++fn is_exact_truthy_builtin<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    ty: Type<'db>,\n    ++    class: KnownClass,\n    ++) -> bool {\n     +    let Type::Intersection(intersection) = ty else {\n     +        return false;\n     +    };\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n     +        .positive(db)\n     +        .iter()\n     +        .copied()\n    -+        .eq([KnownClass::Str.to_instance(db, env)])\n    ++        .eq([class.to_instance(db, env)])\n     +        && intersection\n     +            .negative(db)\n     +            .iter()\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n      /// Intersections that exclude both truthy and falsy values have no single guard.\n      fn excluded_truthiness<'db>(db: &'db dyn Db, ty: Type<'db>) -> Option<Type<'db>> {\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n    -     if literals.is_empty() {\n    +     }) {\n              return false;\n          }\n    +-    let literals: FxHashSet<_> = types\n    +-        .iter()\n    +-        .filter_map(|ty| ty.as_literal_value_kind())\n    +-        .collect();\n     +    // LiteralString can subsume an explicit empty-string member during insertion.\n    -+    let covers_empty_string = literals.iter().any(|literal| match literal {\n    -+        LiteralValueTypeKind::LiteralString => true,\n    -+        LiteralValueTypeKind::String(literal) => literal.value(db).is_empty(),\n    -+        _ => false,\n    -+    });\n    - \n    -     let mut changed = false;\n    -     for ty in types {\n    ++    let mut literals = FxHashSet::default();\n    ++    let mut covers_empty_string = false;\n    ++    let mut covers_empty_bytes = false;\n    ++    let mut covers_zero = false;\n    ++    for literal in types.iter().filter_map(|ty| ty.as_literal_value_kind()) {\n    ++        literals.insert(literal);\n    ++        match literal {\n    ++            LiteralValueTypeKind::LiteralString => covers_empty_string = true,\n    ++            LiteralValueTypeKind::String(literal) => {\n    ++                covers_empty_string |= literal.value(db).is_empty();\n    ++            }\n    ++            LiteralValueTypeKind::Bytes(literal) => {\n    ++                covers_empty_bytes |= literal.value(db).is_empty();\n    ++            }\n    ++            LiteralValueTypeKind::Int(literal) => covers_zero |= literal.as_i64() == 0,\n    ++            LiteralValueTypeKind::Bool(_) => {}\n    ++            LiteralValueTypeKind::Enum(_) => {}\n    ++        }\n    ++    }\n    +     if literals.is_empty() {\n    +         return false;\n    +     }\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n              if !unpack_aliases && any_over_type(db, env, *ty, false, Type::is_alias_like) {\n                  continue;\n              }\n    -+        if covers_empty_string && is_exact_truthy_str(db, env, *ty) {\n    -+            *ty = KnownClass::Str.to_instance(db, env);\n    ++        // Widen the guarded built-in when its matching empty or zero value is present.\n    ++        // This also admits falsy subclass values and, for int, False.\n    ++        let widened_builtin = [\n    ++            (KnownClass::Str, covers_empty_string),\n    ++            (KnownClass::Bytes, covers_empty_bytes),\n    ++            (KnownClass::Int, covers_zero),\n    ++        ]\n    ++        .into_iter()\n    ++        .find_map(|(class, covered)| {\n    ++            (covered && is_exact_truthy_builtin(db, env, *ty, class)).then_some(class)\n    ++        });\n    ++        if let Some(class) = widened_builtin {\n    ++            *ty = class.to_instance(db, env);\n     +            changed = true;\n     +            continue;\n     +        }\n```\n",
          "outcome": "approved",
          "approvedAt": "2026-11-25T15:14:54.126641Z"
        },
        {
          "kind": "amendment",
          "status": "posted",
          "head": "142c9403b03b7e03d5559663823689da81cca214",
          "baseHead": "8a2c814d3c7b236dee569aa55983ca2d06b84d0a",
          "url": "https://github.com/tamird/ruff/commit/142c9403b03b7e03d5559663823689da81cca214",
          "title": "Published normalization amendment range-diff",
          "summary": "Approved 142c9403 is published on PR #30761.",
          "body": "Review the replacement for PR #30761: published `8a2c814d` → proposed `142c9403`. Both single-commit revisions use upstream `493fe0d6639f7e437e01814718ef094373a1bab3` as their base.\n\nThe shared post-insertion pass now widens matching `str`, `bytes`, and `int` fallbacks. It retains `LiteralString` coverage and extra constraints; a `False`-only fallback does not trigger integer widening. The existing OR fixture adds five assertions for bytes/int fallbacks and their negative controls.\n\nThis deliberate widening also applies to written intersection annotations. The broad results admit falsy subclass values; `int` additionally admits `False` and zero-valued `IntEnum` members. Your authorization to prepare and qualify this scope is recorded separately from this source decision.\n\nThe two new positive fallback assertions fail on published `8a2c814d`. The final source passes core 86, semantic 541 (35 ignored), IDE 1,964, all 532 Markdown fixtures, formatting, canonical hooks and strict Clippy on RBE. [Matched controls](https://app.buildbuddy.io/invocation/c8d4ad79-c787-4c61-b380-076bcac0ca11), [native and strict style](https://app.buildbuddy.io/invocation/52b055b4-21b5-4e81-b60c-75fb6c38f3d0), [complete three-file Markdown qualification](https://app.buildbuddy.io/invocation/ee240434-6ef4-4903-97f6-9bcf5497204b).\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/142c9403b03b7e03d5559663823689da81cca214). Updating #30761 requires approval of this source; replies, closure and merge remain held.\n\n## Changes from the submitted commit\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 493fe0d6639f7e437e01814718ef094373a1bab3..8a2c814d3c7b236dee569aa55983ca2d06b84d0a 493fe0d6639f7e437e01814718ef094373a1bab3..142c9403b03b7e03d5559663823689da81cca214\n```\n\n```diff\n1:  8a2c814d3c ! 1:  142c9403b0 [ty] Simplify strings with empty fallbacks\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Simplify strings with empty fallbacks\n    +    [ty] Widen builtins with falsy fallbacks\n     \n    -    Normalize unions of `str & ~AlwaysFalsy` with either `Literal[\"\"]` or\n    -    `LiteralString` to `str`. This lets methods on string fallback expressions\n    -    use ordinary `str` overloads. A literal empty-string receiver still selects\n    -    LiteralString-specific overloads.\n    +    Normalize unions of T & ~AlwaysFalsy with a matching fallback to T for\n    +    builtin str, bytes and int. Match \"\" or LiteralString for str, b\"\" for\n    +    bytes, and integer 0 for int. String fallback expressions can then use\n    +    ordinary str overloads.\n     \n    -    Collect empty-string coverage after union insertion, alongside covered\n    -    literal exclusions. `LiteralString` includes the empty string and can\n    -    subsume an explicit empty-string member while the union is constructed.\n    +    Collect these witnesses after union insertion, alongside covered literal\n    +    exclusions, so normalization does not depend on insertion order.\n    +    LiteralString may have absorbed an explicit empty-string member.\n     \n    -    Match only the builtin `str` core with the single truthiness exclusion.\n    -    Nonempty fallbacks, other intersection constraints and subclass-specific\n    -    cores retain their original handling. This deliberately widens the broad\n    -    `str` annotation for subclasses that override `__bool__` to return false.\n    +    Apply the rule globally, including unions written in annotations. The\n    +    widened builtin types include falsy subclass values. A widened int also\n    +    admits False and IntEnum members whose value is zero. Using False as the\n    +    fallback does not trigger the integer rule. Additional intersection\n    +    constraints, subclass cores and enum cores retain their original\n    +    handling.\n     \n      ## crates/ty_python_semantic/resources/mdtest/expression/boolean.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str):\n    @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str\n     +    reveal_type((foo or \"\").split())  # revealed: list[str]\n     +    reveal_type(foo or \"fallback\")  # revealed: str & ~AlwaysFalsy\n     +\n    ++def _(data: bytes, number: int):\n    ++    reveal_type(data or b\"\")  # revealed: bytes\n    ++    reveal_type(data or b\"fallback\")  # revealed: bytes & ~AlwaysFalsy\n    ++    reveal_type(number or 0)  # revealed: int\n    ++    reveal_type(number or 1)  # revealed: int & ~AlwaysFalsy\n    ++    reveal_type(number or False)  # revealed: (int & ~AlwaysFalsy) | Literal[False]\n    ++\n     +# A literal receiver still selects the LiteralString overload.\n     +reveal_type(\"\".split())  # revealed: list[LiteralString]\n     +\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n      use rustc_hash::FxHashSet;\n      use smallvec::SmallVec;\n      \n    -+fn is_exact_truthy_str<'db>(db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>) -> bool {\n    ++fn is_exact_truthy_builtin<'db>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    ty: Type<'db>,\n    ++    class: KnownClass,\n    ++) -> bool {\n     +    let Type::Intersection(intersection) = ty else {\n     +        return false;\n     +    };\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n     +        .positive(db)\n     +        .iter()\n     +        .copied()\n    -+        .eq([KnownClass::Str.to_instance(db, env)])\n    ++        .eq([class.to_instance(db, env)])\n     +        && intersection\n     +            .negative(db)\n     +            .iter()\n    @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Ite\n      /// Intersections that exclude both truthy and falsy values have no single guard.\n      fn excluded_truthiness<'db>(db: &'db dyn Db, ty: Type<'db>) -> Option<Type<'db>> {\n     @@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n    -     if literals.is_empty() {\n    +     }) {\n              return false;\n          }\n    +-    let literals: FxHashSet<_> = types\n    +-        .iter()\n    +-        .filter_map(|ty| ty.as_literal_value_kind())\n    +-        .collect();\n     +    // LiteralString can subsume an explicit empty-string member during insertion.\n    -+    let covers_empty_string = literals.iter().any(|literal| match literal {\n    -+        LiteralValueTypeKind::LiteralString => true,\n    -+        LiteralValueTypeKind::String(literal) => literal.value(db).is_empty(),\n    -+        _ => false,\n    -+    });\n    - \n    -     let mut changed = false;\n    -     for ty in types {\n    ++    let mut literals = FxHashSet::default();\n    ++    let mut covers_empty_string = false;\n    ++    let mut covers_empty_bytes = false;\n    ++    let mut covers_zero = false;\n    ++    for literal in types.iter().filter_map(|ty| ty.as_literal_value_kind()) {\n    ++        literals.insert(literal);\n    ++        match literal {\n    ++            LiteralValueTypeKind::LiteralString => covers_empty_string = true,\n    ++            LiteralValueTypeKind::String(literal) => {\n    ++                covers_empty_string |= literal.value(db).is_empty();\n    ++            }\n    ++            LiteralValueTypeKind::Bytes(literal) => {\n    ++                covers_empty_bytes |= literal.value(db).is_empty();\n    ++            }\n    ++            LiteralValueTypeKind::Int(literal) => covers_zero |= literal.as_i64() == 0,\n    ++            LiteralValueTypeKind::Bool(_) => {}\n    ++            LiteralValueTypeKind::Enum(_) => {}\n    ++        }\n    ++    }\n    +     if literals.is_empty() {\n    +         return false;\n    +     }\n    +@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n              if !unpack_aliases && any_over_type(db, env, *ty, false, Type::is_alias_like) {\n                  continue;\n              }\n    -+        if covers_empty_string && is_exact_truthy_str(db, env, *ty) {\n    -+            *ty = KnownClass::Str.to_instance(db, env);\n    ++        // Widen the guarded built-in when its matching empty or zero value is present.\n    ++        // This also admits falsy subclass values and, for int, False.\n    ++        let widened_builtin = [\n    ++            (KnownClass::Str, covers_empty_string),\n    ++            (KnownClass::Bytes, covers_empty_bytes),\n    ++            (KnownClass::Int, covers_zero),\n    ++        ]\n    ++        .into_iter()\n    ++        .find_map(|(class, covered)| {\n    ++            (covered && is_exact_truthy_builtin(db, env, *ty, class)).then_some(class)\n    ++        });\n    ++        if let Some(class) = widened_builtin {\n    ++            *ty = class.to_instance(db, env);\n     +            changed = true;\n     +            continue;\n     +        }\n```\n",
          "outcome": "posted",
          "postedAt": "2026-11-25T15:14:54.126641Z",
          "postedURL": "https://github.com/astral-sh/ruff/pull/30761"
        },
        {
          "kind": "amendment",
          "status": "approved",
          "baseHead": "142c9403b03b7e03d5559663823689da81cca214",
          "head": "7b148056cd81a79c3b67ce5afcfdcfba1e6f565a",
          "url": "https://github.com/tamird/ruff/commit/7b148056cd81a79c3b67ce5afcfdcfba1e6f565a",
          "title": "Inferred-or amendment approved",
          "summary": "Tamir approved 7b148056cd, now published on Ruff #30761.",
          "outcome": "approved"
        },
        {
          "kind": "amendment",
          "status": "settled",
          "head": "7b148056cd81a79c3b67ce5afcfdcfba1e6f565a",
          "baseHead": "142c9403b03b7e03d5559663823689da81cca214",
          "url": "https://github.com/tamird/ruff/commit/7b148056cd81a79c3b67ce5afcfdcfba1e6f565a",
          "title": "Review inferred-or widening for Ruff #30761",
          "summary": "Tamir approved 7b148056cd, now published on Ruff #30761.",
          "body": "The revised patch widens only an inferred `or` result with a matching final fallback and no expected type. It keeps the explicit truthiness union intact, including when an annotated return requires it. A union supplied entirely by the final operand, as in `False or value`, retains its precision.\n\nThe reduced `pytest-autoprofile` case uses the reported return expression and the project's `ImportPath` annotations. It fails on the upstream parent and passes with this revision. `LiteralString` receivers still retain literal split results. The conditional and tuple probes still produce `list[str] | list[LiteralString]`. This revision confines the precision tradeoff to `or` expressions and leaves the other cases open.\n\nCanonical hooks, native suites, all 532 mdtests, formatting, and strict Clippy passed. [RBE results](https://app.buildbuddy.io/invocation/617505e3-98eb-409a-a523-d5e68a065c2a)\n\nCaptured with `git range-diff --no-color --no-dual-color --creation-factor=999 142c9403b03b7e03d5559663823689da81cca214^! 7b148056cd81a79c3b67ce5afcfdcfba1e6f565a^!`.\n\n```diff\n1:  142c9403b0 ! 1:  7b148056cd [ty] Widen builtins with falsy fallbacks\n    @@ Metadata\n     Author: Tamir Duberstein <tamird@gmail.com>\n     \n      ## Commit message ##\n    -    [ty] Widen builtins with falsy fallbacks\n    +    [ty] Widen inferred or fallbacks\n     \n    -    Normalize unions of T & ~AlwaysFalsy with a matching fallback to T for\n    -    builtin str, bytes and int. Match \"\" or LiteralString for str, b\"\" for\n    -    bytes, and integer 0 for int. String fallback expressions can then use\n    -    ordinary str overloads.\n    +    In pytest-autoprofile, (target.object or \"\").split(\".\") inferred\n    +    list[str] | list[LiteralString]. The return annotation wants list[str],\n    +    and list's invariant element type prevents that assignment.\n     \n    -    Collect these witnesses after union insertion, alongside covered literal\n    -    exclusions, so normalization does not depend on insertion order.\n    -    LiteralString may have absorbed an explicit empty-string member.\n    +    When an unconstrained or expression combines a truthy builtin with its\n    +    matching final fallback, use the builtin as the result type. This\n    +    allows calls such as split to select the ordinary builtin overload.\n    +    The widened type can include falsy subclass instances, so retain the\n    +    precise union when a caller supplies an expected type.\n     \n    -    Apply the rule globally, including unions written in annotations. The\n    -    widened builtin types include falsy subclass values. A widened int also\n    -    admits False and IntEnum members whose value is zero. Using False as the\n    -    fallback does not trigger the integer rule. Additional intersection\n    -    constraints, subclass cores and enum cores retain their original\n    -    handling.\n    +    Match the type of the final operand before widening. An or expression\n    +    such as False or value can return a union supplied entirely by value.\n     \n      ## crates/ty_python_semantic/resources/mdtest/expression/boolean.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str):\n    @@ crates/ty_python_semantic/resources/mdtest/expression/boolean.md: def _(foo: str\n     +    reveal_type(number or 0)  # revealed: int\n     +    reveal_type(number or 1)  # revealed: int & ~AlwaysFalsy\n     +    reveal_type(number or False)  # revealed: (int & ~AlwaysFalsy) | Literal[False]\n    ++```\n     +\n    -+# A literal receiver still selects the LiteralString overload.\n    -+reveal_type(\"\".split())  # revealed: list[LiteralString]\n    ++An expected type can preserve the truthiness constraint.\n     +\n    -+from typing import LiteralString\n    ++```py\n    ++from typing import Literal\n    ++from ty_extensions import AlwaysFalsy, Intersection, Not\n     +\n    -+def _(s: str, t: LiteralString, i: int):\n    -+    reveal_type(s or t)  # revealed: str\n    -+    if s:\n    -+        a: list[str] = (s, t, \"\")[i].split()  # ok\n    -+        b: list[str] = (t, s, \"\")[i].split()  # ok\n    ++def _(value: str) -> Intersection[str, Not[AlwaysFalsy]] | Literal[\"\"]:\n    ++    return value or \"\"\n      ```\n      \n      ## AND\n     \n    - ## crates/ty_python_semantic/resources/mdtest/narrow/len.md ##\n    -@@ crates/ty_python_semantic/resources/mdtest/narrow/len.md: def _(x: Literal[\"foo\", \"\"] | list[int]):\n    -         reveal_type(x)  # revealed: Literal[\"\"] | list[int]\n    - ```\n    - \n    --## Narrowing away empty literals\n    -+## An empty fallback restores `str`\n    - \n    --This pattern is common when a prior truthiness check narrows a type, and then a conditional\n    --expression adds an empty literal back:\n    -+A truthiness check narrows a string, but adding an empty string back restores broad `str`, in either\n    -+branch order. A later length check leaves that type unchanged:\n    - \n    - ```py\n    - def _(lines: list[str]):\n    -@@ crates/ty_python_semantic/resources/mdtest/narrow/len.md: def _(lines: list[str]):\n    - \n    -         reveal_type(line)  # revealed: str & ~AlwaysFalsy\n    -         value = line if len(line) < 3 else \"\"\n    --        reveal_type(value)  # revealed: (str & ~AlwaysFalsy) | Literal[\"\"]\n    -+        reveal_type(value)  # revealed: str\n    -+        value = \"\" if len(line) < 3 else line\n    -+        reveal_type(value)  # revealed: str\n    + ## crates/ty_python_semantic/src/types/infer/builder.rs ##\n    +@@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n    +         // accumulating prior types cannot affect inference.\n    +         let track_peer_types = values.iter().skip(1).any(is_collection_literal)\n    +             && prefer_collection_literal_peer_context(self.db(), self.program_environment(), tcx);\n    +-        self.infer_chained_boolean_types(\n    ++        let can_widen = matches!(op, ast::BoolOp::Or) && tcx.expected_type().is_none();\n    ++        let mut fallback = None;\n    ++        let result = self.infer_chained_boolean_types(\n    +             *op,\n    +             track_peer_types,\n    +             values.iter().enumerate(),\n    +             |(_, value)| is_collection_literal(value),\n    +             |builder, (index, value), peer_ty| {\n    +                 let ty = if index == values.len() - 1 {\n    +-                    builder\n    +-                        .infer_expression_with_collection_literal_peer_context(value, tcx, peer_ty)\n    ++                    let ty = builder\n    ++                        .infer_expression_with_collection_literal_peer_context(value, tcx, peer_ty);\n    ++                    if can_widen {\n    ++                        fallback = Some(ty);\n    ++                    }\n    ++                    ty\n    +                 } else {\n    +                     builder.infer_maybe_standalone_expression_with_collection_literal_peer_context(\n    +                         value, tcx, peer_ty,\n    +@@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n      \n    -         if len(value):\n    --            # `Literal[\"\"]` is removed, `str & ~AlwaysFalsy` is unchanged\n    --            reveal_type(value)  # revealed: str & ~AlwaysFalsy\n    --            # Accessing value[0] is safe here\n    -+            reveal_type(value)  # revealed: str\n    -             _ = value[0]\n    - ```\n    -\n    - ## crates/ty_python_semantic/src/types/set_theoretic/builder.rs ##\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: use itertools::Itertools;\n    - use rustc_hash::FxHashSet;\n    - use smallvec::SmallVec;\n    - \n    -+fn is_exact_truthy_builtin<'db>(\n    -+    db: &'db dyn Db,\n    -+    env: &ProgramEnvironment<'db>,\n    -+    ty: Type<'db>,\n    -+    class: KnownClass,\n    -+) -> bool {\n    -+    let Type::Intersection(intersection) = ty else {\n    -+        return false;\n    -+    };\n    -+    intersection\n    -+        .positive(db)\n    -+        .iter()\n    -+        .copied()\n    -+        .eq([class.to_instance(db, env)])\n    -+        && intersection\n    -+            .negative(db)\n    -+            .iter()\n    -+            .copied()\n    -+            .eq([Type::AlwaysFalsy])\n    -+}\n    +                 (ty, value.range())\n    +             },\n    +-        )\n    +-        .value_type\n    ++        );\n    ++        if let Some(fallback) = fallback {\n    ++            self.widen_or_fallback(result.value_type, fallback)\n    ++        } else {\n    ++            result.value_type\n    ++        }\n    ++    }\n     +\n    - /// The truthiness excluded by a single guard, e.g. `AlwaysFalsy` in `A & ~AlwaysFalsy`.\n    - /// Intersections that exclude both truthy and falsy values have no single guard.\n    - fn excluded_truthiness<'db>(db: &'db dyn Db, ty: Type<'db>) -> Option<Type<'db>> {\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n    -     }) {\n    -         return false;\n    -     }\n    --    let literals: FxHashSet<_> = types\n    --        .iter()\n    --        .filter_map(|ty| ty.as_literal_value_kind())\n    --        .collect();\n    -+    // LiteralString can subsume an explicit empty-string member during insertion.\n    -+    let mut literals = FxHashSet::default();\n    -+    let mut covers_empty_string = false;\n    -+    let mut covers_empty_bytes = false;\n    -+    let mut covers_zero = false;\n    -+    for literal in types.iter().filter_map(|ty| ty.as_literal_value_kind()) {\n    -+        literals.insert(literal);\n    -+        match literal {\n    -+            LiteralValueTypeKind::LiteralString => covers_empty_string = true,\n    -+            LiteralValueTypeKind::String(literal) => {\n    -+                covers_empty_string |= literal.value(db).is_empty();\n    ++    /// An empty fallback can make `(s or \"\").split()` select both the `str`\n    ++    /// and `LiteralString` overloads. Widen the inferred result to the builtin\n    ++    /// so those overloads do not see separate union members.\n    ++    fn widen_or_fallback(&self, result: Type<'db>, fallback: Type<'db>) -> Type<'db> {\n    ++        let db = self.db();\n    ++        let Type::Union(union) = result else {\n    ++            return result;\n    ++        };\n    ++        let [left, right] = union.elements(db) else {\n    ++            return result;\n    ++        };\n    ++        let guarded = if *right == fallback {\n    ++            *left\n    ++        } else if *left == fallback {\n    ++            *right\n    ++        } else {\n    ++            return result;\n    ++        };\n    ++        let Type::Intersection(guarded) = guarded else {\n    ++            return result;\n    ++        };\n    ++        if !guarded.negative(db).iter().copied().eq([Type::AlwaysFalsy]) {\n    ++            return result;\n    ++        }\n    ++\n    ++        let builtin = match fallback.as_literal_value_kind() {\n    ++            Some(LiteralValueTypeKind::LiteralString) => Some(KnownClass::Str),\n    ++            Some(LiteralValueTypeKind::String(value)) => {\n    ++                value.value(db).is_empty().then_some(KnownClass::Str)\n     +            }\n    -+            LiteralValueTypeKind::Bytes(literal) => {\n    -+                covers_empty_bytes |= literal.value(db).is_empty();\n    ++            Some(LiteralValueTypeKind::Bytes(value)) => {\n    ++                value.value(db).is_empty().then_some(KnownClass::Bytes)\n     +            }\n    -+            LiteralValueTypeKind::Int(literal) => covers_zero |= literal.as_i64() == 0,\n    -+            LiteralValueTypeKind::Bool(_) => {}\n    -+            LiteralValueTypeKind::Enum(_) => {}\n    ++            Some(LiteralValueTypeKind::Int(value)) => {\n    ++                (value.as_i64() == 0).then_some(KnownClass::Int)\n    ++            }\n    ++            _ => None,\n    ++        };\n    ++        let Some(builtin) = builtin else {\n    ++            return result;\n    ++        };\n    ++        let widened = builtin.to_instance(db, self.program_environment());\n    ++        if guarded.positive(db).iter().copied().eq([widened]) {\n    ++            widened\n    ++        } else {\n    ++            result\n     +        }\n    -+    }\n    -     if literals.is_empty() {\n    -         return false;\n          }\n    -@@ crates/ty_python_semantic/src/types/set_theoretic/builder.rs: fn normalize_covered_literal_exclusions<'db>(\n    -         if !unpack_aliases && any_over_type(db, env, *ty, false, Type::is_alias_like) {\n    -             continue;\n    -         }\n    -+        // Widen the guarded built-in when its matching empty or zero value is present.\n    -+        // This also admits falsy subclass values and, for int, False.\n    -+        let widened_builtin = [\n    -+            (KnownClass::Str, covers_empty_string),\n    -+            (KnownClass::Bytes, covers_empty_bytes),\n    -+            (KnownClass::Int, covers_zero),\n    -+        ]\n    -+        .into_iter()\n    -+        .find_map(|(class, covered)| {\n    -+            (covered && is_exact_truthy_builtin(db, env, *ty, class)).then_some(class)\n    -+        });\n    -+        if let Some(class) = widened_builtin {\n    -+            *ty = class.to_instance(db, env);\n    -+            changed = true;\n    -+            continue;\n    -+        }\n    -         if let Some(widened) = remove_covered_exclusions(db, env, *ty, |excluded| {\n    -             excluded\n    -                 .as_literal_value_kind()\n    + \n    +     /// Computes the output of a chain of (one) boolean operation, consuming as input an iterator\n```",
          "outcome": "posted",
          "postedAt": "2026-11-25T19:59:53+00:00",
          "postedURL": "https://github.com/astral-sh/ruff/pull/30761"
        }
      ],
      "followup": {
        "owner": "Agent",
        "sourceHead": "7b148056cd81a79c3b67ce5afcfdcfba1e6f565a",
        "nextAction": "CodSpeed reports a 5.23% regression. Matched RBE rounds were about 2% slower, with overlapping timings. Checking the fallback literal earlier did not help. Keep the current revision and have a maintainer confirm the hosted result before deciding on the tradeoff."
      },
      "refinement": {
        "before": {
          "head": "142c9403b03b7e03d5559663823689da81cca214"
        },
        "after": {
          "head": "7b148056cd81a79c3b67ce5afcfdcfba1e6f565a"
        }
      }
    },
    {
      "id": "branch:residual-truthiness-guards",
      "type": "branch",
      "repo": "tamird/ruff",
      "title": "Simplify residual truthiness guards",
      "group": "ty",
      "status": "Redesign required",
      "ref": "validation/joint-truthiness-guards",
      "url": "https://github.com/tamird/ruff/commit/7b813717d3098e237cf8beb97eb5f046bf6230bc",
      "evidence": [
        {
          "label": "Combined proposal and rewritten comments",
          "url": "https://github.com/tamird/ruff/commit/7b813717d3098e237cf8beb97eb5f046bf6230bc"
        },
        {
          "label": "Native and five-fixture qualification",
          "url": "https://app.buildbuddy.io/invocation/f2696a7d-6873-472c-8038-ed4b105293d7"
        },
        {
          "label": "Full original default Markdown: 532 pass",
          "url": "https://app.buildbuddy.io/invocation/6cbb61e0-873f-4c47-9673-fdfba3af5285"
        },
        {
          "label": "Full prototype default Markdown: 24 failures",
          "url": "https://app.buildbuddy.io/invocation/2cffb9f4-4e6b-48e5-8cb1-305c20ee1651"
        },
        {
          "label": "Current Dulwich and SymPy diagnostic comparison",
          "url": "https://app.buildbuddy.io/invocation/773c2717-bcbf-47f7-a4a6-11f3aa0bf813"
        }
      ],
      "head": "7b813717d3098e237cf8beb97eb5f046bf6230bc",
      "summary": "Prototype combining #27106 with immutable-value guards. Full qualification found lost predicate and exception-type information. Keep this prototype out of Sty; fix the string-splitting bug at its method-binding owner. Nothing has been submitted upstream.\n\nFocused native checks pass, but full default Markdown is 508/532 versus pristine upstream 532/532. Current Dulwich and SymPy checks also add diagnostics. No golden assertions were weakened. Global guard removal is unqualified and will not be promoted.\n\nThis proposal is not approved for upstream submission.",
      "followup": {
        "owner": "Agent",
        "sourceHead": "7b813717d3098e237cf8beb97eb5f046bf6230bc",
        "nextAction": "Fix the original string-splitting bug at method binding while preserving internal guards, negative constraints and inference order. This global-removal prototype is not ready for submission."
      }
    },
    {
      "id": "pr:27106",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 27106,
      "title": "Drop residual truthiness guards from intersections",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/27106",
      "summary": "Draft global guard-removal proposal. Full qualification found lost predicate and exception information. A separate method-binding fix for the original string-splitting bug now passes all 532 default Markdown cases with guards retained; current Dulwich and SymPy diagnostics are unchanged.",
      "evidence": []
    },
    {
      "id": "pr:30759",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 30759,
      "title": "Retain call-completion query keys",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/30759",
      "summary": "Merged by AlexWaygood on November 22, 2026 as Ruff #30759. The approved 1b9535 revision retains call-completion query keys as semantic-index outputs and includes the deterministic dependency regression.\n\nThe current 1b9535 amendment passes the focused deterministic dependency regression, the full semantic suite (516 passed, 35 ignored), canonical hooks, formatting and strict Clippy. The same regression fails on submitted 5678. It verifies the absence of an interned-call-key dependency when validating the cached semantic index; it does not claim to force eviction on every CPU or shard count. Earlier 5678/e905 native and benchmark results remain historical evidence; no new hardware or performance claim is made.\n\nTamir approved the exact 1b9535 amendment for PR #30759; it is now the published head.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/a604f8ac5b27f9bfe1f594878c5d1fddbca23520"
        },
        {
          "label": "Current-base refresh: independent guarded phases",
          "url": "https://app.buildbuddy.io/invocation/4076d5be-7ee1-4e87-a1ed-5a6f5a0e0520"
        },
        {
          "label": "Review the revised single commit",
          "url": "https://github.com/tamird/ruff/commit/5678a81398ae87c721118445dd539e568f940c10"
        },
        {
          "label": "Matched baseline and complete functional qualification",
          "url": "https://app.buildbuddy.io/invocation/1e98da07-c0a4-4ec7-bfa3-30f51a281f29"
        },
        {
          "label": "Original repeated-call benchmarks with profiling code generation",
          "url": "https://app.buildbuddy.io/invocation/9a013a63-e833-4f89-9470-35264ab4d88b"
        },
        {
          "label": "Proposed1b9535 amendment: deterministic dependency regression",
          "url": "https://github.com/tamird/ruff/commit/1b9535f986af582c86f75977c4741c3b93eac83e"
        },
        {
          "label": "1b9535: focused regression, full semantic suite, hooks and style",
          "url": "https://app.buildbuddy.io/invocation/94b0a1df-fff3-4102-af51-7c19d032ca3c"
        },
        {
          "label": "Submitted5678: matched deterministic dependency failure",
          "url": "https://app.buildbuddy.io/invocation/b0a41fcc-1144-423e-a4bb-c9b4365a34ef"
        }
      ],
      "head": "1b9535f986af582c86f75977c4741c3b93eac83e",
      "settledReviews": [
        {
          "kind": "proposal",
          "head": "5678a81398ae87c721118445dd539e568f940c10",
          "url": "https://github.com/tamird/ruff/commit/5678a81398ae87c721118445dd539e568f940c10",
          "outcome": "approved",
          "summary": "Tamir approved this exact commit after confirmation of the existing negative controls."
        },
        {
          "kind": "amendment",
          "head": "1b9535f986af582c86f75977c4741c3b93eac83e",
          "baseHead": "5678a81398ae87c721118445dd539e568f940c10",
          "url": "https://github.com/tamird/ruff/commit/1b9535f986af582c86f75977c4741c3b93eac83e",
          "title": "Review the call-key dependency revision for PR #30759",
          "summary": "Tamir approved the exact 1b9535 amendment for PR #30759; it is now the published head.",
          "body": "Review the amendment to PR #30759. The PR still publishes `5678a813`; this proposed replacement is `1b9535f`. The earlier approval does not cover this amendment.\n\nThe revision adds a deterministic check that validating an unchanged semantic index does not depend on interned call keys. It fails on the submitted commit and passes with the amendment. The original optimization sentence is restored. This test does not claim to force slot eviction on every CPU or shard count.\n\nThe focused regression, full semantic suite (516 passed, 35 ignored), canonical hooks, formatting and strict Clippy pass. [Candidate qualification](https://app.buildbuddy.io/invocation/94b0a1df-fff3-4102-af51-7c19d032ca3c); [matched baseline failure](https://app.buildbuddy.io/invocation/b0a41fcc-1144-423e-a4bb-c9b4365a34ef).\n\n## Changes from the submitted commit\n\nThis is Git’s actual range-diff of the two single-commit proposals on the same base. The pairing option matches the replacement commit with its predecessor.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc..5678a81398ae87c721118445dd539e568f940c10 7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc..1b9535f986af582c86f75977c4741c3b93eac83e\n```\n\n```diff\n1:  5678a81398 ! 1:  1b9535f986 [ty] Retain call-completion query keys\n    @@ Commit message\n         unchanged file when its interned call-completion keys were collected.\n     \n         Make these keys tracked outputs of the semantic-index query, matching the\n    -    lifetime of the expressions they contain. Cover reuse across unrelated\n    -    revisions and invalidation after the indexed source changes.\n    +    lifetime of the expressions they contain. Check the dependency directly\n    +    after a low-durability write so the regression test does not depend on an\n    +    LRU shard reusing a slot. Keep the check that editing the indexed source\n    +    still invalidates the index.\n     \n      ## crates/ty_python_core/src/predicate.rs ##\n     @@ crates/ty_python_core/src/predicate.rs: impl PredicateOrLiteral<'_> {\n    @@ crates/ty_python_core/src/predicate.rs: impl PredicateOrLiteral<'_> {\n     -/// queries use its ID directly, without looking up its components in Salsa's intern table again.\n     -#[salsa::interned(debug, heap_size=ruff_memory_usage::heap_size)]\n     +/// A call-completion query key owned by the semantic index that creates its expressions.\n    ++///\n    ++/// Creating it while building predicates lets cached queries use its ID directly, without looking\n    ++/// up its components in Salsa's intern table again.\n    ++///\n     +/// Tracking the key keeps unrelated revisions from collecting it and invalidating that index.\n     +#[salsa::tracked(debug, heap_size=ruff_memory_usage::heap_size)]\n      pub struct CallableAndCallExpr<'db> {\n    @@ crates/ty_python_semantic/src/types/infer/tests.rs: fn dependency_implicit_alias\n     +        ruff_db::system::SystemPath::new(\"/src/project\"),\n     +        ruff_db::files::FileRootKind::Project,\n     +    );\n    -+    let source = format!(\"def run(callback):\\n{}\", \"    callback()\\n\".repeat(4));\n    -+    db.write_file(\"/src/project/target.py\", &source)?;\n    ++    let source = \"def run(callback):\\n    callback()\\n\";\n    ++    db.write_file(\"/src/project/target.py\", source)?;\n     +    let file = system_path_to_file(&db, \"/src/project/target.py\")?;\n    -+    let mut others = Vec::new();\n    -+    for revision in 0..4 {\n    -+        let path = format!(\"/src/project/other_{revision}.py\");\n    -+        db.write_file(&path, \"\")?;\n    -+        let other = system_path_to_file(&db, &path)?;\n    -+        others.push((path, other));\n    -+    }\n     +    semantic_index(&db, program_file(&db, file));\n    -+    // Fresh call keys in four revisions age Salsa's three-revision retention queue.\n    -+    for (path, other) in others {\n    -+        let source = format!(\"def run(callback):\\n{}\", \"    callback()\\n\".repeat(16));\n    -+        db.write_file(&path, source)?;\n    -+        semantic_index(&db, program_file(&db, other));\n    -+    }\n    ++\n    ++    db.synthetic_write(salsa::Durability::LOW);\n     +    db.clear_salsa_events();\n     +    semantic_index(&db, program_file(&db, file));\n     +    let events = db.take_salsa_events();\n     +    assert_function_query_was_not_run(&db, semantic_index, program_file(&db, file), &events);\n    ++    assert!(\n    ++        !events.iter().any(|event| matches!(\n    ++            event.kind,\n    ++            salsa::EventKind::DidValidateInternedValue { key, .. }\n    ++                if db.ingredient_debug_name(key.ingredient_index()) == \"CallableAndCallExpr\"\n    ++        )),\n    ++        \"validating the semantic index depended on an interned call key\"\n    ++    );\n     +\n     +    db.write_file(\"/src/project/target.py\", format!(\"{source}changed = 1\\n\"))?;\n     +    semantic_index(&db, program_file(&db, file));\n```\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/1b9535f986af582c86f75977c4741c3b93eac83e). No PR-head update or maintainer reply has been posted.",
          "outcome": "approved"
        }
      ],
      "refinement": {
        "before": {
          "head": "5678a81398ae87c721118445dd539e568f940c10"
        },
        "after": {
          "head": "1b9535f986af582c86f75977c4741c3b93eac83e"
        }
      }
    },
    {
      "id": "pr:30848",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 30848,
      "title": "[ty] Preserve literals in loop unpacking",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/30848",
      "summary": "PR #30848 now publishes 50c072, the one-line visibility repair of approved 6f413cc6. Shared sequence extraction and the uniform List/Tuple promotion policy are unchanged.\n\nCurrent 50c072 removes only helper visibility and passes semantic 515 (35 ignored), canonical hooks, formatting and strict Clippy. Python behavior and tests are unchanged; exact 6f retains the prior 532 Markdown, native and style proof. The measured benchmark remains exact 6f versus direct upstream parent 7d1: List 60.20 to 15.61 ms and Tuple 56.78 to 15.24 ms (one 256-pair shape, same-worker ABBA, 30 samples/run). The visibility-only head was not measured. The older 31bf comparison is historical. No general speedup or network-mode qualification is claimed.\n\nDelivered the one-line private-visibility CI repair of the 6f contribution under its existing approval; Tamir’s exact approval remains recorded on 6f.",
      "evidence": [
        {
          "label": "Delivered 50c072 visibility-only repair",
          "url": "https://github.com/tamird/ruff/commit/50c072ba534604a0f69f0f4645f2441974201271"
        },
        {
          "label": "Visibility repair: semantic tests, canonical hooks and strict style",
          "url": "https://app.buildbuddy.io/invocation/e0223e27-df23-4576-a308-6d5458e56199"
        },
        {
          "label": "Submitted Ruff PR #30848",
          "url": "https://github.com/astral-sh/ruff/pull/30848"
        },
        {
          "label": "Exact upstream-parent 7d1 versus 6f: 256-pair List/Tuple ABBA comparison",
          "url": "https://app.buildbuddy.io/invocation/088bcff0-12dc-4ac7-8006-3783c004ef8d"
        },
        {
          "label": "6f413cc6 shared extraction and bounded loop joins",
          "url": "https://github.com/tamird/ruff/commit/6f413cc6e6675225ce6f30e3e49c82f3929644fd"
        },
        {
          "label": "6f413cc6: final 532 Markdown, semantic, IDE and strict style qualification",
          "url": "https://app.buildbuddy.io/invocation/53184f7a-f684-4bbf-b5fc-7c00fcbb5b6d"
        },
        {
          "label": "Core 86 and ten consumer fixtures before equivalent early-return rewrite",
          "url": "https://app.buildbuddy.io/invocation/200e642c-8ec0-4064-9103-a3125d5bc690"
        },
        {
          "label": "Historical: 31bf versus 6f, 256-pair List/Tuple same-worker ABBA comparison",
          "url": "https://app.buildbuddy.io/invocation/2c8b5c1e-742f-41aa-889a-9d240b30307b"
        },
        {
          "label": "Historical: 31bf complete expression-iteration owner commit",
          "url": "https://github.com/tamird/ruff/commit/31bf4e4fd869f34c947e32701f5c5af386106587"
        },
        {
          "label": "Historical: 31bf: five whole boundary fixtures, 532 default Markdown and native/style qualification",
          "url": "https://app.buildbuddy.io/invocation/fbee6f68-fbd4-45e8-9d96-1324c61d391b"
        },
        {
          "label": "Historical: New comments-only 6e08 commit",
          "url": "https://github.com/tamird/ruff/commit/6e08e84a339ee7d27a36371c2b439db84cf58a3d"
        },
        {
          "label": "Historical: 6e08 canonical hooks; verified unchanged code/tests and reused native proof",
          "url": "https://app.buildbuddy.io/invocation/06b8444c-860c-4a54-a164-eaffb7b17c21"
        },
        {
          "label": "Historical: New f69 single commit for review",
          "url": "https://github.com/tamird/ruff/commit/f69b792ae4530552c91cff7375a2b6f2e9497a5c"
        },
        {
          "label": "Historical: f69: five fixtures, semantic tests and successful style build; wrapper-count failure disclosed",
          "url": "https://app.buildbuddy.io/invocation/378c990e-1dd7-4bca-9dae-aaf45f4c77d6"
        },
        {
          "label": "Historical: Earlier bf95: Current-base refresh: independent guarded phases",
          "url": "https://app.buildbuddy.io/invocation/4076d5be-7ee1-4e87-a1ed-5a6f5a0e0520"
        },
        {
          "label": "Historical: Earlier bf95: Review the single upstream commit",
          "url": "https://github.com/tamird/ruff/commit/bf95f29c54153597cd59bfb602fe5e56aa965e75"
        },
        {
          "label": "Historical: Earlier bf95: Matched baseline and revised qualification",
          "url": "https://app.buildbuddy.io/invocation/3e27961a-71f9-4e9f-abd3-526529ae6c41"
        }
      ],
      "head": "50c072ba534604a0f69f0f4645f2441974201271",
      "settledReviews": [
        {
          "kind": "proposal",
          "status": "approved",
          "head": "6f413cc6e6675225ce6f30e3e49c82f3929644fd",
          "baseHead": "7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc",
          "url": "https://github.com/tamird/ruff/commit/6f413cc6e6675225ce6f30e3e49c82f3929644fd",
          "title": "Review shared sequence extraction and bounded loop joins",
          "summary": "Tamir approved exact 6f413cc6 for upstream submission; it is published as PR #30848.",
          "body": "Review `6f413cc6`, replacing `31bf`. List and tuple displays now use the same sequence extraction as namedtuple, pytest and dynamic-class metadata. Metadata retains exact entries. Loops apply the existing 64-element promotion policy before joining those entries, uniformly for List and Tuple; explicitly annotated literals remain protected. Lazy root types, early stopping at unknown starred shapes, aliases and async recovery are retained.\n\nIn one same-worker ABBA workload with 256 distinct pairs, List changed from 82.96 to 22.39 ms and Tuple from 22.55 to 21.61 ms (30 samples per run). This is one shape and size, not a general performance claim. [Measurements](https://app.buildbuddy.io/invocation/2c8b5c1e-742f-41aa-889a-9d240b30307b).\n\nAll 532 default Markdown fixtures, semantic 515 (35 ignored), IDE 1964 and strict style checks pass on the final source. Core 86 passed before an equivalent early-return rewrite; the final Markdown run repeats all ten consumer fixtures. Existing List/Tuple blocks were reused, with no new suite. [Qualification](https://app.buildbuddy.io/invocation/53184f7a-f684-4bbf-b5fc-7c00fcbb5b6d).\n\n## Changes from the previous proposal\n\nUser approval is required before upstream submission.\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc..31bf4e4fd869f34c947e32701f5c5af386106587 7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc..6f413cc6e6675225ce6f30e3e49c82f3929644fd\n```\n\n```diff\n1:  31bf4e4fd8 ! 1:  6f413cc6e6 [ty] Preserve literals in loop unpacking\n    @@ Metadata\n      ## Commit message ##\n         [ty] Preserve literals in loop unpacking\n     \n    -    Destructuring an immediately consumed list widened literal elements,\n    -    while single-target iteration preserved them. Share expression iteration\n    -    between loop targets, comprehensions, and unpacking so display precision\n    -    and ordinary iteration have one owner.\n    +    Recover the same fixed sequence from immediately consumed list and tuple\n    +    displays when inferring loop targets. Share that recovery with declaration\n    +    metadata, retaining exact values and positions for names, defaults, and\n    +    class bases.\n     \n    -    Read already-inferred expression types, leaving error reporting and\n    -    recovery at the callers. Preserve the existing asynchronous target\n    -    behavior and the fixed-length iterable extractor.\n    +    Apply the existing literal promotion budget before joining loop elements\n    +    from large displays. This avoids expensive unions of distinct literal\n    +    tuples for either container, while preserving explicitly annotated literal\n    +    types. Keep ordinary iteration results and errors instead of discarding\n    +    variable-length results and iterating again.\n     \n      ## crates/ty_python_semantic/resources/mdtest/unpacking.md ##\n     @@ crates/ty_python_semantic/resources/mdtest/unpacking.md: for a, b in ((1, 2), (3, 4)):\n          reveal_type(b)  # revealed: Literal[2, 4]\n      ```\n      \n    -+### Large tuple literals\n    ++### Large list literals\n     +\n    -+Tuple inference widens literal types in tuples with more than 64 elements to limit inference cost.\n    -+Destructured loop targets preserve this widening.\n    ++Large display iterations widen inferred literals before combining their element types. This also\n    ++limits the cost of destructuring many distinct tuple elements.\n     +\n     +```py\n     +# fmt: off\n    -+for a, b in (\n    ++for a, b in [\n     +    (0, 0), (1, 1), (2, 2), (3, 3), (4, 4),\n     +    (5, 5), (6, 6), (7, 7), (8, 8), (9, 9),\n     +    (10, 10), (11, 11), (12, 12), (13, 13), (14, 14),\n    @@ crates/ty_python_semantic/resources/mdtest/unpacking.md: for a, b in ((1, 2), (3\n     +    (50, 50), (51, 51), (52, 52), (53, 53), (54, 54),\n     +    (55, 55), (56, 56), (57, 57), (58, 58), (59, 59),\n     +    (60, 60), (61, 61), (62, 62), (63, 63), (64, 64),\n    -+):\n    ++]:\n     +    reveal_type(a)  # revealed: int\n     +    reveal_type(b)  # revealed: int\n     +# fmt: on\n    @@ crates/ty_python_semantic/resources/mdtest/unpacking.md: for a, b in ((1, 2), (3\n     +\n     +### Large tuple literals with a single target\n     +\n    -+A single loop target preserves the same tuple inference limit as destructuring.\n    ++The same promotion budget applies when a loop has a single target.\n     +\n     +```py\n     +# fmt: off\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: use crate::types::infer::{\n      use crate::types::match_pattern::{ClassPatternPositionalResult, class_pattern_positional_result};\n      use crate::types::member::{class_body_declaration_from_bases, inherited_class_body_declaration};\n      use crate::types::narrow::NarrowingEvaluatorExtension;\n    +@@ crates/ty_python_semantic/src/types/infer/builder.rs: use crate::types::typevar::{\n    +     BoundTypeVarIdentity, TypeVarConstraints, TypeVarIdentity, TypeVarInstance, TypeVarSet,\n    + };\n    + use crate::types::unpacker::{\n    +-    UnpackResult, fixed_sequence_elements, sequence_from_literal_elements,\n    +-    tuple_literal_needs_promotion,\n    ++    UnpackResult, fixed_sequence_elements, literal_sequence_needs_promotion,\n    ++    sequence_from_literal_elements,\n    + };\n    + use crate::types::visitor::any_over_type_expanding_aliases;\n    + use crate::types::{\n     @@ crates/ty_python_semantic/src/types/infer/builder.rs: use crate::types::{\n          SentinelInstance, Signature, SpecialFormType, SubclassOfType, Type, TypeAliasType,\n          TypeAndQualifiers, TypeContext, TypeQualifiers, TypeVarBoundOrConstraints, TypeVarKind,\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                  }\n              };\n      \n    +@@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n    +         };\n    +         let spec = sequence_from_literal_elements(\n    +             elts,\n    +-            tuple_literal_needs_promotion(elts),\n    ++            literal_sequence_needs_promotion(elts),\n    +             &inferred_type,\n    +             &|expression, promote, known_length| {\n    +                 // Starred-expression inference has already reported iteration errors.\n     @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {\n                  // TODO: `infer_comprehension_definition` reports a diagnostic if `iter_ty` isn't iterable\n                  //  but only if the target is a name. We should report a diagnostic here if the target isn't a name:\n    @@ crates/ty_python_semantic/src/types/infer/builder.rs: impl<'db, 'ast> TypeInfere\n                  }\n              };\n      \n    +@@ crates/ty_python_semantic/src/types/infer/builder.rs: impl TupleInferenceMode {\n    +     /// when the tuple is large enough to require literal promotion.\n    +     fn for_literal(tuple: &ast::ExprTuple) -> Self {\n    +         if tuple.elts.iter().any(ast::Expr::is_starred_expr)\n    +-            || tuple_literal_needs_promotion(&tuple.elts)\n    ++            || literal_sequence_needs_promotion(&tuple.elts)\n    +         {\n    +             Self::WholeTuple\n    +         } else {\n     \n      ## crates/ty_python_semantic/src/types/iteration.rs ##\n     @@\n      use crate::Db;\n      use crate::ProgramEnvironment;\n     +use crate::types::dict::dict_literal_key_value_types;\n    ++use crate::types::unpacker::{literal_sequence_needs_promotion, sequence_elts};\n      use crate::types::{\n          AwaitError, Bindings, CallArguments, CallDunderError, KnownClass, LintDiagnosticGuard,\n          LintDiagnosticGuardBuilder, LiteralValueTypeKind, Type, TypeContext, TypeVarBoundOrConstraints,\n     @@ crates/ty_python_semantic/src/types/iteration.rs: pub(crate) fn extract_fixed_length_iterable_element_types<'db>(\n    -     Some(element_types.into_boxed_slice())\n    - }\n    +     iterable: &ast::Expr,\n    +     mut expression_type: impl FnMut(&ast::Expr) -> Type<'db>,\n    + ) -> Option<Box<[Type<'db>]>> {\n    +-    fn extend_fixed_length_iterable<'db>(\n    ++    let sequence = try_iterate_expression(db, env, iterable, &mut expression_type, |provider| {\n    ++        provider(iterable)\n    ++    })\n    ++    .ok()\n    ++    .flatten()?;\n    ++    let elements = sequence.as_fixed_length()?;\n    ++    Some(elements.all_elements().to_vec().into_boxed_slice())\n    ++}\n    ++\n    ++// Keep the ordinary type lazy: deferred declaration metadata can inspect literal children\n    ++// without inferring their container, and loop callers retain their authoritative inferred type.\n    ++fn try_iterate_expression<'db, F>(\n    ++    db: &'db dyn Db,\n    ++    env: &ProgramEnvironment<'db>,\n    ++    iterable: &ast::Expr,\n    ++    expression_type: &mut F,\n    ++    ordinary_type: impl FnOnce(&mut F) -> Type<'db>,\n    ++) -> Result<Option<Cow<'db, TupleSpec<'db>>>, IterationError<'db>>\n    ++where\n    ++    F: FnMut(&ast::Expr) -> Type<'db>,\n    ++{\n    ++    fn fixed_literal_sequence<'db>(\n    +         db: &'db dyn Db,\n    +         env: &ProgramEnvironment<'db>,\n    +-        iterable: &ast::Expr,\n    ++        elements: &[ast::Expr],\n    +         expression_type: &mut impl FnMut(&ast::Expr) -> Type<'db>,\n    +-        element_types: &mut Vec<Type<'db>>,\n    +-    ) -> Option<()> {\n    +-        let elements = match iterable {\n    +-            ast::Expr::List(list) => Some(&list.elts),\n    +-            ast::Expr::Tuple(tuple) => Some(&tuple.elts),\n    +-            _ => None,\n    +-        };\n    +-\n    +-        if let Some(elements) = elements {\n    +-            for element in elements {\n    +-                if let ast::Expr::Starred(starred) = element {\n    +-                    extend_fixed_length_iterable(\n    +-                        db,\n    +-                        env,\n    +-                        starred.value.as_ref(),\n    +-                        expression_type,\n    +-                        element_types,\n    +-                    )?;\n    ++    ) -> Option<TupleSpec<'db>> {\n    ++        let mut sequence = TupleSpecBuilder::with_capacity(elements.len());\n    ++        for element in elements {\n    ++            if let ast::Expr::Starred(starred) = element {\n    ++                let value = starred.value.as_ref();\n    ++                let unpacked = if let Some(elements) = sequence_elts(value) {\n    ++                    Cow::Owned(fixed_literal_sequence(db, env, elements, expression_type)?)\n    +                 } else {\n    +-                    element_types.push(expression_type(element));\n    +-                }\n    ++                    expression_type(value).try_iterate(db, env).ok()?\n    ++                };\n    ++                unpacked.as_fixed_length()?;\n    ++                sequence = sequence.concat(db, env, &unpacked);\n    ++            } else {\n    ++                sequence.push(expression_type(element));\n    +             }\n    +-            return Some(());\n    +         }\n    ++        Some(sequence.build())\n    ++    }\n      \n    +-        let iterable_type = expression_type(iterable);\n    +-        let spec = iterable_type.try_iterate(db, env).ok()?;\n    +-        let tuple = spec.as_fixed_length()?;\n    +-        element_types.extend(tuple.all_elements().iter().copied());\n    +-        Some(())\n    ++    let Some(elements) = sequence_elts(iterable) else {\n    ++        return ordinary_type(expression_type)\n    ++            .try_iterate(db, env)\n    ++            .map(Some);\n    ++    };\n    ++    Ok(fixed_literal_sequence(db, env, elements, expression_type).map(Cow::Owned))\n    ++}\n    ++\n     +/// Return the element type of an already-inferred iterable expression.\n     +pub(super) fn iterable_element_type<'db>(\n     +    db: &'db dyn Db,\n     +    env: &ProgramEnvironment<'db>,\n     +    iterable_type: Type<'db>,\n     +    iterable: &ast::Expr,\n    -+    expression_type: impl FnMut(&ast::Expr) -> Type<'db>,\n    ++    mut expression_type: impl FnMut(&ast::Expr) -> Type<'db>,\n     +    mode: EvaluationMode,\n     +) -> Result<Type<'db>, IterationError<'db>> {\n    -+    if !mode.is_async() {\n    -+        match iterable {\n    -+            ast::Expr::List(_) => {\n    -+                // List inference promotes literals for later mutation. This display is consumed\n    -+                // immediately, so use its already-inferred element expression types.\n    -+                if let Some(element_types) =\n    -+                    extract_fixed_length_iterable_element_types(db, env, iterable, expression_type)\n    -+                    && !element_types.is_empty()\n    -+                {\n    -+                    return Ok(UnionType::from_elements(\n    -+                        db,\n    -+                        env,\n    -+                        element_types.iter().copied(),\n    -+                    ));\n    -+                }\n    -+            }\n    -+            ast::Expr::Dict(dict) => {\n    -+                if let Some((keys, _values)) =\n    -+                    dict_literal_key_value_types(db, env, dict, expression_type)\n    -+                {\n    -+                    return Ok(keys);\n    -+                }\n    -+            }\n    -+            _ => {}\n    -+        }\n    ++    if mode.is_async() {\n    ++        return iterable_type\n    ++            .try_iterate_with_mode(db, env, mode)\n    ++            .map(|tuple| tuple.homogeneous_element_type(db, env));\n     +    }\n    -+    iterable_type\n    -+        .try_iterate_with_mode(db, env, mode)\n    -+        .map(|tuple| tuple.homogeneous_element_type(db, env))\n    -+}\n    -+\n    ++    if let ast::Expr::Dict(dict) = iterable\n    ++        && let Some((keys, _values)) =\n    ++            dict_literal_key_value_types(db, env, dict, &mut expression_type)\n    ++    {\n    ++        return Ok(keys);\n    +     }\n    + \n    +-    let mut element_types = Vec::new();\n    +-    extend_fixed_length_iterable(db, env, iterable, &mut expression_type, &mut element_types)?;\n    +-    Some(element_types.into_boxed_slice())\n    ++    let literal_elements = sequence_elts(iterable);\n    ++    let extracted =\n    ++        try_iterate_expression(db, env, iterable, &mut expression_type, |_| iterable_type)?;\n    ++    // Failed or variable-length literal expansions use the inferred container type. Inference\n    ++    // already reported starred-expression errors, and an empty list keeps its ordinary recovery.\n    ++    let extracted = extracted.filter(|sequence| {\n    ++        literal_elements.is_none()\n    ++            || sequence\n    ++                .as_fixed_length()\n    ++                .is_some_and(|elements| !elements.all_elements().is_empty())\n    ++    });\n    ++    let sequence = match extracted {\n    ++        Some(sequence) => sequence,\n    ++        None => iterable_type.try_iterate(db, env)?,\n    ++    };\n    ++    if let Some(elements) = sequence.as_fixed_length()\n    ++        && !elements.all_elements().is_empty()\n    ++    {\n    ++        // Promote before constructing unions of distinct literal tuples, which the generic\n    ++        // literal-union caps do not cover. Lists and tuples use the same sequence limit.\n    ++        let promote = literal_elements.is_some_and(literal_sequence_needs_promotion);\n    ++        return Ok(UnionType::from_elements_leave_aliases(\n    ++            db,\n    ++            env,\n    ++            elements\n    ++                .iter_all_elements()\n    ++                .map(|ty| if promote { ty.promote(db, env) } else { ty }),\n    ++        ));\n    ++    }\n    ++    Ok(sequence.homogeneous_element_type(db, env))\n    + }\n    + \n      impl<'db> Type<'db> {\n    -     /// Recognizes coroutines whose results can be iterated over asynchronously.\n    -     ///\n     \n      ## crates/ty_python_semantic/src/types/unpacker.rs ##\n     @@ crates/ty_python_semantic/src/types/unpacker.rs: use ruff_python_ast::{self as ast, AnyNodeRef};\n    @@ crates/ty_python_semantic/src/types/unpacker.rs: impl<'db, 'ast> Unpacker<'db, '\n                  }\n                  UnpackKind::ContextManager { mode } => {\n                      let env = self.context.program_environment();\n    +@@ crates/ty_python_semantic/src/types/unpacker.rs: fn literal_sequence_elements(\n    +     // `a, *rest = (items := [1, \"two\"])` has the same elements as the list itself.\n    +     let expression = expression.expression_value();\n    +     let values = sequence_elts(expression)?;\n    +-    let promote = promote || (expression.is_tuple_expr() && tuple_literal_needs_promotion(values));\n    ++    let promote =\n    ++        promote || (expression.is_tuple_expr() && literal_sequence_needs_promotion(values));\n    +     Some((values, promote))\n    + }\n    + \n    +-/// Applies the tuple precision limit after expanding literal elements. For `(*[1, 2], 3)`,\n    ++/// Applies the literal precision limit after expanding sequence elements. For `(*[1, 2], 3)`,\n    + /// all three positions count, even though the outer tuple has only two AST elements.\n    + /// Other starred iterables count as one item because their elements are not recovered from\n    + /// literal syntax. Stop counting as soon as the limit is exceeded.\n    +-pub(super) fn tuple_literal_needs_promotion(values: &[ast::Expr]) -> bool {\n    +-    /// Limit literal precision in large tuple expressions to avoid pathological inference costs.\n    +-    const MAX_TUPLE_LENGTH_FOR_UNANNOTATED_LITERAL_INFERENCE: usize = 64;\n    ++pub(super) fn literal_sequence_needs_promotion(values: &[ast::Expr]) -> bool {\n    ++    /// Limit literal precision in large sequence expressions to avoid pathological inference costs.\n    ++    const MAX_SEQUENCE_LENGTH_FOR_LITERAL_INFERENCE: usize = 64;\n    + \n    +     fn remaining_budget(values: &[ast::Expr], remaining: usize) -> Option<usize> {\n    +         values.iter().try_fold(remaining, |remaining, value| {\n    +@@ crates/ty_python_semantic/src/types/unpacker.rs: pub(super) fn tuple_literal_needs_promotion(values: &[ast::Expr]) -> bool {\n    +         })\n    +     }\n    + \n    +-    remaining_budget(values, MAX_TUPLE_LENGTH_FOR_UNANNOTATED_LITERAL_INFERENCE).is_none()\n    ++    remaining_budget(values, MAX_SEQUENCE_LENGTH_FOR_LITERAL_INFERENCE).is_none()\n    + }\n    + \n    + /// Builds a literal's sequence shape from already-inferred elements and iterable shapes.\n    +@@ crates/ty_python_semantic/src/types/unpacker.rs: fn literal_iterable_length(expression: &ast::Expr) -> Option<usize> {\n    + }\n    + \n    + /// Extract the element slice from a list or tuple expression.\n    +-fn sequence_elts(expr: &ast::Expr) -> Option<&[ast::Expr]> {\n    ++pub(super) fn sequence_elts(expr: &ast::Expr) -> Option<&[ast::Expr]> {\n    +     match expr {\n    +         ast::Expr::List(list) => Some(&list.elts),\n    +         ast::Expr::Tuple(tuple) => Some(&tuple.elts),\n```\n\n[Read the complete proposed commit](https://github.com/tamird/ruff/commit/6f413cc6e6675225ce6f30e3e49c82f3929644fd).",
          "outcome": "approved"
        },
        {
          "kind": "amendment",
          "head": "50c072ba534604a0f69f0f4645f2441974201271",
          "baseHead": "6f413cc6e6675225ce6f30e3e49c82f3929644fd",
          "url": "https://github.com/tamird/ruff/commit/50c072ba534604a0f69f0f4645f2441974201271",
          "postedURL": "https://github.com/astral-sh/ruff/pull/30848",
          "title": "Delivered visibility repair of the approved loop contribution",
          "summary": "Delivered the one-line private-visibility CI repair of the 6f contribution under its existing approval; Tamir’s exact approval remains recorded on 6f.",
          "body": "PR #30848 now publishes `50c072ba`, the visibility-only repair of approved `6f413cc6`. It removes `pub(super)` from an iteration helper whose uses are all in the same module. Python behavior, tests and benchmark code are unchanged. This is authorized delivery of the approved contribution, not a new exact-head user approval.\n\nThe visibility repair passes semantic 515 (35 ignored), canonical hooks, formatting and strict Clippy. The original 6f native and all-532-Markdown qualification remains applicable to the unchanged behavior. [Repair qualification](https://app.buildbuddy.io/invocation/e0223e27-df23-4576-a308-6d5458e56199). The direct upstream-parent benchmark measured exact 6f against 7d1: List 60.20 to 15.61 ms and Tuple 56.78 to 15.24 ms in one 256-pair same-worker ABBA workload. The later visibility-only head was not measured; no general performance claim is made. [Measurements](https://app.buildbuddy.io/invocation/088bcff0-12dc-4ac7-8006-3783c004ef8d).\n\n## Changes from the approved contribution\n\n```sh\ngit range-diff --no-color --no-dual-color --creation-factor=999 7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc..6f413cc6e6675225ce6f30e3e49c82f3929644fd 7d1b1355ef43bc9169ec5743667ca2a6cdbde2dc..50c072ba534604a0f69f0f4645f2441974201271\n```\n\n```diff\n1:  6f413cc6e6 ! 1:  50c072ba53 [ty] Preserve literals in loop unpacking\n    @@ crates/ty_python_semantic/src/types/iteration.rs: pub(crate) fn extract_fixed_le\n      }\n      \n      impl<'db> Type<'db> {\n    +@@ crates/ty_python_semantic/src/types/iteration.rs: impl<'db> Type<'db> {\n    +         self.try_iterate_with_mode(db, env, EvaluationMode::Sync)\n    +     }\n    + \n    +-    pub(super) fn try_iterate_with_mode(\n    ++    fn try_iterate_with_mode(\n    +         self,\n    +         db: &'db dyn Db,\n    +         env: &ProgramEnvironment<'db>,\n     \n      ## crates/ty_python_semantic/src/types/unpacker.rs ##\n     @@ crates/ty_python_semantic/src/types/unpacker.rs: use ruff_python_ast::{self as ast, AnyNodeRef};\n```\n\n[Read the delivered commit](https://github.com/tamird/ruff/commit/50c072ba534604a0f69f0f4645f2441974201271).",
          "outcome": "posted"
        }
      ],
      "refinement": {
        "before": {
          "head": "6f413cc6e6675225ce6f30e3e49c82f3929644fd"
        },
        "after": {
          "head": "50c072ba534604a0f69f0f4645f2441974201271"
        }
      }
    },
    {
      "id": "pr:29027",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29027,
      "title": "Add existential quantification nodes",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29027",
      "summary": "Overlaps the fork's existential binders, freshening and signed proofs. Compare source and runtime behavior before extracting another binder implementation.",
      "evidence": []
    },
    {
      "id": "pr:27665",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 27665,
      "title": "Collect type context from function calls during full-scope bidirectional inference",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/27665",
      "summary": "Existing collection-context implementation overlaps the fork: identity-specialized collection calls, sibling constraints, original overload filtering and protection against self-feedback. Reconcile later refinements with this PR before proposing additions.",
      "evidence": []
    },
    {
      "id": "pr:29553",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29553,
      "title": "Stabilize lambda inference with finite signatures",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29553",
      "summary": "Stabilizes lambda identity and signature inference. Compare this work before extracting contextual lambda and callback changes; source overlap is still being reviewed.",
      "evidence": []
    },
    {
      "id": "pr:29681",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29681,
      "title": "Respect declared dictionary value types when narrowing keys",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29681",
      "summary": "Preserves declared dictionary value types using annotated-assignment rules. Related to observation policy; it does not establish that the fork's snapshot and transfer implementation is already upstream.",
      "evidence": []
    },
    {
      "id": "pr:23937",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 23937,
      "title": "Support narrowing with aliased conditional expressions",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/23937",
      "summary": "Handles cross-scope and chained condition aliases through structural places and reassignment snapshots. Reconcile with the fork's saved member, key and call histories; these implementations are not equivalent.",
      "evidence": []
    },
    {
      "id": "pr:27661",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 27661,
      "title": "Resolve deferred references from current and future bindings",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/27661",
      "summary": "Resolves deferred annotations from current and future bindings. Compare with host source/stub and foreign annotation changes before proposing overlapping lookup work.",
      "evidence": []
    },
    {
      "id": "pr:29555",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29555,
      "title": "Experiment with generic FunctionType inference",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29555",
      "summary": "Experiments with generic FunctionType and MethodType. Compare the callable representation and ParamSpec requirements before extracting related function and method changes.",
      "evidence": []
    },
    {
      "id": "pr:29138",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29138,
      "title": "Local keyword dictionaries",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29138",
      "summary": "In upstream review. Zsol contribution; use as an upstream template.",
      "evidence": []
    },
    {
      "id": "pr:29141",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29141,
      "title": "Conditional keyword dictionaries",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29141",
      "summary": "In upstream review. Zsol contribution; use as an upstream template.",
      "evidence": []
    },
    {
      "id": "pr:29186",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29186,
      "title": "Alternative semantic-index design",
      "group": "ty",
      "status": "open",
      "url": "https://github.com/astral-sh/ruff/pull/29186",
      "summary": "Related upstream design. Related upstream work; inspect before proposing overlapping changes.",
      "evidence": []
    },
    {
      "id": "pr:28820",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 28820,
      "title": "Dictionary-key completions",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/28820",
      "summary": "Merged. Zsol contribution; use as an upstream template.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/6cddbe8ee3"
        }
      ]
    },
    {
      "id": "pr:28821",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 28821,
      "title": "Literal call unpacking",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/28821",
      "summary": "Merged. Zsol contribution; use as an upstream template.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/da9e37289d"
        }
      ]
    },
    {
      "id": "pr:29131",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29131,
      "title": "Empty collection peers",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/29131",
      "summary": "Merged. Zsol contribution; use as an upstream template.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/5d16eb00e9"
        }
      ]
    },
    {
      "id": "pr:29135",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29135,
      "title": "Composite Final restrictions",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/29135",
      "summary": "Merged. Zsol contribution; use as an upstream template.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/73e6c488b6"
        }
      ]
    },
    {
      "id": "pr:29136",
      "type": "pr",
      "repo": "astral-sh/ruff",
      "number": 29136,
      "title": "Absent closed-TypedDict get defaults",
      "group": "ty",
      "status": "merged",
      "url": "https://github.com/astral-sh/ruff/pull/29136",
      "summary": "Merged. Zsol contribution; use as an upstream template.",
      "evidence": [
        {
          "label": "Upstream merge",
          "url": "https://github.com/astral-sh/ruff/commit/97aa1f69d8"
        }
      ]
    }
  ],
  "edges": [
    {
      "from": "pr:bazelbuild/bazel-skylib:643",
      "to": "pr:bazelbuild/bazel-skylib:641",
      "type": "includes",
      "reason": "Extracted from Skylib #641; runtime duplicate-label diagnostic fix.",
      "evidence": [
        "https://github.com/bazelbuild/bazel-skylib/pull/643"
      ]
    },
    {
      "from": "pr:bazelbuild/bazel-skylib:647",
      "to": "pr:bazelbuild/bazel-skylib:641",
      "type": "includes",
      "reason": "Buildifier documentation/parser compatibility; recorded inside Skylib #641.",
      "evidence": [
        "https://github.com/bazelbuild/bazel-skylib/pull/647"
      ]
    }
  ],
  "investigations": [
    {
      "id": "investigation:checker",
      "title": "Build an excellent Bazel Starlark checker",
      "owner": "Tamir / Agent",
      "summary": "Use ty for inference and incrementality; qualify real implementations and intentionally incorrect callers.",
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "evidence": [
        {
          "label": "sty source",
          "url": "https://github.com/tamird/sty"
        }
      ],
      "findings": []
    },
    {
      "id": "investigation:bazel",
      "title": "Improve upstream Bazel type checking",
      "owner": "Tamir / Agent",
      "summary": "Reduce discovered gaps to reproducible examples, distinguish host behavior from checker behavior, and prepare evidence-backed feedback.",
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "evidence": [
        {
          "label": "sty source",
          "url": "https://github.com/tamird/sty"
        }
      ],
      "findings": []
    },
    {
      "id": "investigation:ty",
      "title": "Return general improvements to ty",
      "owner": "Tamir / Agent",
      "summary": "Adapt isolated improvements to Python semantics and upstream architecture. Track merged work and avoid duplicating contributions already in review.",
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "evidence": [
        {
          "label": "sty source",
          "url": "https://github.com/tamird/sty"
        }
      ],
      "findings": []
    },
    {
      "id": "investigation:community",
      "title": "Give community projects complete support",
      "owner": "Tamir / Agent",
      "summary": "Prioritize prominent projects with engaged maintainers, especially active #hermeticbuild participants. Keep supported Bazel versions, source annotations, stubs, real callers, and CI consistent.",
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "evidence": [
        {
          "label": "sty source",
          "url": "https://github.com/tamird/sty"
        }
      ],
      "findings": []
    },
    {
      "id": "investigation:hosts",
      "title": "Make the work reusable by other Starlark hosts",
      "owner": "Tamir / Agent",
      "summary": "Keep general inference and Starlark language behavior separate from Bazel APIs and repository discovery. Investigate Buck2 as another host; support is not yet established.",
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "evidence": [
        {
          "label": "sty source",
          "url": "https://github.com/tamird/sty"
        }
      ],
      "findings": []
    },
    {
      "id": "investigation:ty-inplace-notimplemented",
      "title": "Fall back when an in-place operator returns NotImplemented",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Submitted upstream. Tamir approved exact 0af5b7f2e, submitted as Ruff #30898. The in-place NotImplemented correction preserves other return alternatives and uses existing ordinary/reflected dispatch.",
      "nextStep": "Reconcile the fork with the outcome of upstream PR #30898 after review and merge.",
      "findings": [
        {
          "text": "Treat NotImplemented from in-place operations as binary fallback — crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Qualified independent in-place NotImplemented fallback on current upstream — crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/resources/mdtest/assignment/augmented.md",
          "evidence": [
            {
              "label": "0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9",
              "url": "https://github.com/tamird/ruff/commit/0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/infer/builder.rs#L5354"
        },
        {
          "label": "Approved standalone contribution",
          "url": "https://github.com/tamird/ruff/commit/0af5b7f2e02fa2efddd6b6ff0cc1e37af09142b9"
        },
        {
          "label": "Submitted upstream PR #30898",
          "url": "https://github.com/astral-sh/ruff/pull/30898"
        }
      ]
    },
    {
      "id": "investigation:ty-protocol-collection-context",
      "title": "Use nongeneric protocols as collection literal context",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Use compatible protocol members to infer collection elements, including nested TypedDict fields. A protocol need not declare a type parameter to supply useful context. Extraction and runtime qualification remain incomplete.",
      "nextStep": "Compare with upstream #27665 before extracting; qualify aliases, unions, missing and extra fields, and incompatible index signatures.",
      "findings": [
        {
          "text": "Use nongeneric protocol members as collection literal context — crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/infer/builder.rs#L7197"
        }
      ]
    },
    {
      "id": "investigation:ty-boolean-payload-tuples",
      "title": "Retain Boolean tags alongside tuple payloads",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Keep the relationship between a Boolean tag and its payload when a tuple is formed from local values. Extraction and runtime qualification remain incomplete.",
      "nextStep": "Reduce a Python example; verify mutations, loop headers, ownership of the source values and subsequent narrowing.",
      "findings": [
        {
          "text": "Retain tag/payload relationships when forming tuples from passive locals — crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Keep settled recursive payloads during unpack narrowing. Reuses existing alias-aware indeterminate-inference owner; no new singleton-row or coinductive acceptance policy. Next: Preserve settled recursive payload regression alongside correlated union rows, genuine provisional/divergent markers and growing-alias refusal.",
          "evidence": [
            {
              "label": "Existing indeterminate marker predicate",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/unpacker.rs#L335",
              "blob": "6367fdeb22350d7ca89748569b214d300f0f833a"
            },
            {
              "label": "Recursive payload remains visible after tuple unpacking",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/narrow/complex_target.md#L321",
              "blob": "aa2d371873e958cd9fc86a19e1168f546ff6bc1b"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/infer/builder.rs#L8099"
        }
      ]
    },
    {
      "id": "investigation:ty-collection-use-inference",
      "title": "Reconcile collection-use inference with upstream #27665",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Fork correction qualified; upstream extraction pending. The published checker retains complete later contexts for empty dictionaries, lists and sets. Skylib root and Gazelle checks now pass. Thirty native cases and incremental query-order controls cover generic keys, aliases, conflicting consumers and invalid writes; current-upstream extraction and overlap review remain open.",
      "nextStep": "Reduce the correction on current upstream and compare with ibraheemdev’s draft PR27665 at e344ca6974. Its four-file patch collects context from generic calls with one tracked collection argument; do not treat it as equivalent to selecting complete later invariant contexts. Preserve invalid writes, caller variables, conflicting consumers and query-order coverage before requesting Tamir review.",
      "findings": [
        {
          "text": "Infer one tracked collection argument from sibling call constraints without self-feedback — crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Reuse checked collection-write argument types. General Python inference correction; integrates fork identity-write path. Next: Keep the two synthesized argument invariant explicit; qualify fresh/nested/callable RHS and invalid-write diagnostics alongside query-order cycles.",
          "evidence": [
            {
              "label": "infer/builder/subscript.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder/subscript.rs#L1896",
              "blob": "7d83cf9a1fc9141ba992ced7baca5fa170fcda48"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Preserve caller types in empty collection contexts. General Python inference candidate within the existing collection-use owner; upstream overlap review remains open. Next: Compare with upstream PR27665 at its exact head, reduce the fix on current upstream, and preserve conflicting-consumer, invalid-write, alias and query-order controls before requesting Tamir review.",
          "evidence": [
            {
              "label": "Complete later collection context",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder.rs#L9250",
              "blob": "c113fadc12f327faf94a2bf522bb476c8f374353"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Published collection correction",
          "url": "https://github.com/tamird/ruff/commit/7ee1132fd198c1b1de4971af746cf875c0a07e84"
        },
        {
          "label": "Thirty actual cases and stable repository hooks",
          "url": "https://app.buildbuddy.io/invocation/3254b6ac-fab4-40ea-9416-3e21728421fd"
        },
        {
          "label": "Experimental run: existing collection regressions restored; new context controls still fail",
          "url": "https://app.buildbuddy.io/invocation/4f07218d-8e09-4dfc-aef3-0cb1c7c1feca"
        },
        {
          "label": "Existing collection-context workstream #27665",
          "url": "https://github.com/astral-sh/ruff/pull/27665"
        },
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/infer/builder.rs#L10413"
        }
      ]
    },
    {
      "id": "investigation:ty-operator-context",
      "title": "Use expected types when inferring operator calls",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Normal and reflected operator calls can use the caller's expected type. Keep dispatch order and cache identity correct. Source reviewed at dfe98a7d; extraction and runtime qualification remain incomplete.",
      "nextStep": "Reduce a Python example; test reflected subclass priority, contextual callbacks and recursive calls.",
      "findings": [
        {
          "text": "Contextual inference at the actual selected binary operator call — crates/ty_python_semantic/src/types/call.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call.rs#L235"
        }
      ]
    },
    {
      "id": "investigation:ty-constructor-class-arguments",
      "title": "Keep explicit constructor type arguments fixed",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python bugfix candidate. Infer omitted class parameters during construction while preserving parameters explicitly supplied by the caller. Source reviewed at dfe98a7d; extraction and runtime qualification remain incomplete.",
      "nextStep": "Compare C(...) with C[int](...) on upstream; cover both __new__ and __init__, receiver overrides and omitted constructor stages.",
      "findings": [
        {
          "text": "Keep explicit constructor class arguments fixed — crates/ty_python_semantic/src/types/call/bind/constructor.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Infer only class arguments owned by this constructor call. ConstructorBinding tracks inferable class context separately from result type. Explicit class arguments remain fixed even when caller TypeVars occur in them; overriding instance with fixed TypeVar/intersection clears stale inferable class context. Partial specialization only produces placeholders for actually inferable class binders. Next: Already attributed in class-call-context dfe inventory. Retain explicit generic constructor and caller-bound-TypeVar tests before extraction.",
          "evidence": [
            {
              "label": "types/call/bind/constructor.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind/constructor.rs#L55"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Record constructor stages discarded before requirements were retained. has_omitted_stage records lost downstream stages when mapping bindings. Checked input evidence cannot claim complete argument requirements if a constructor stage was omitted. Next: Verify two-stage new/init negative evidence cases.",
          "evidence": [
            {
              "label": "types/call/bind/constructor.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind/constructor.rs#L62"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Projection enum import and instance-type visibility. Support APIs for explicit inferable constructor context and argument projection. Next: Carry with owning behavior.",
          "evidence": [
            {
              "label": "types/call/bind/constructor.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind/constructor.rs#L8"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind/constructor.rs#L52"
        }
      ]
    },
    {
      "id": "investigation:ty-typed-dict-key-groups",
      "title": "Group TypedDict.get keys without losing literals",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Submitted upstream. Tamir approved exact 5d2628cbb, submitted as Ruff #30897. The TypedDict.get correction groups keys only within one declared value-type and requiredness group; mixed groups keep existing fallback behavior.",
      "nextStep": "Reconcile the fork with the outcome of upstream PR #30897 after review and merge.",
      "findings": [
        {
          "text": "Preserve precise get results for unions of equivalent literal keys — crates/ty_python_semantic/src/types/class/typed_dict.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Qualified independent grouping of equivalent TypedDict.get keys — crates/ty_python_semantic/src/types/class/typed_dict.rs, crates/ty_python_semantic/resources/mdtest/typed_dict.md",
          "evidence": [
            {
              "label": "5d2628cbb2296f33d81828f6ce34a7140a36e5e4",
              "url": "https://github.com/tamird/ruff/commit/5d2628cbb2296f33d81828f6ce34a7140a36e5e4"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/class/typed_dict.rs#L391"
        },
        {
          "label": "Approved standalone contribution",
          "url": "https://github.com/tamird/ruff/commit/5d2628cbb2296f33d81828f6ce34a7140a36e5e4"
        },
        {
          "label": "Submitted upstream PR #30897",
          "url": "https://github.com/astral-sh/ruff/pull/30897"
        }
      ]
    },
    {
      "id": "investigation:ty-typed-dict-views",
      "title": "Derive TypedDict views from dictionary declarations",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement / host API candidate. Use the configured dictionary declarations for keys, values and items views while retaining each schema's key and value types. Source reviewed at dfe98a7d; extraction and runtime qualification remain incomplete.",
      "nextStep": "Qualify ordinary Python view classes plus open, closed and extra-item schemas; test a host with custom dictionary views.",
      "findings": [
        {
          "text": "Derive TypedDict items/keys/values from configured dict declarations — crates/ty_python_semantic/src/types/class/typed_dict.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/class/typed_dict.rs#L6"
        }
      ]
    },
    {
      "id": "investigation:ty-typed-dict-merge",
      "title": "Preserve overwrite direction in TypedDict merges",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Infer merge result values from the operand that wins each key, including additional keys and reflected operations. Source reviewed at dfe98a7d; extraction and runtime qualification remain incomplete.",
      "nextStep": "Reduce upstream failures; check both operand orders, read-only extra items and the fresh ordinary dictionary result.",
      "findings": [
        {
          "text": "Preserve merge direction, schema values and fresh dictionary results — crates/ty_python_semantic/src/types/class/typed_dict.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/class/typed_dict.rs#L6"
        }
      ]
    },
    {
      "id": "investigation:ty-known-generic-subclass",
      "title": "Specialize known generic subclasses before checking them",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python bugfix candidate. Apply default specialization when checking subclasses of known generic classes. Source reviewed at dfe98a7d; extraction and runtime qualification remain incomplete.",
      "nextStep": "Produce a minimal Python regression on upstream and verify recursive subtype checks.",
      "findings": [
        {
          "text": "Use default specialization for known generic subclass checks — crates/ty_python_semantic/src/types/class/known.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/class/known.rs#L1518"
        }
      ]
    },
    {
      "id": "investigation:ty-factory-instance-storage",
      "title": "Separate factory instance fields from class descriptors",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host API design. Host-created instances need field storage whose callable values remain ordinary fields; class descriptors retain their own binding behavior. Source reviewed at dfe98a7d; extraction and runtime qualification remain incomplete.",
      "nextStep": "Agree the reusable API; qualify optional and dynamic fields, recursive types, source identity and callable field access.",
      "findings": [
        {
          "text": "Separate factory-supplied immutable instance storage from class descriptors — crates/ty_python_semantic/src/types/class/dynamic_literal.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Reviewed implementation",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/class/dynamic_literal.rs#L3"
        }
      ]
    },
    {
      "id": "investigation:host-buck2-source-modes",
      "title": "Buck2 file modes and builtin scopes",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host adaptation not implemented. Sty currently selects Standard or Bazel dialects; native annotations and builtin extensions are tied to Bazel. Buck2 needs distinct BUCK, rule-definition and BXL environments. Existing ty parser and supplied-binding hooks are reusable boundaries, not established Buck2 support.",
      "nextStep": "Separate host file modes and builtin catalog selection from Bazel metadata; qualify native annotations and isolation between Buck2 environments.",
      "findings": [],
      "evidence": [
        {
          "label": "Current dialect and annotation-mode owner",
          "url": "https://github.com/tamird/sty/blob/0e6aed3cf87fe18936ee8c36762e8085eb668af3/crates/starpls_common/src/lib.rs#L21"
        },
        {
          "label": "Current Bazel builtin-extension owner",
          "url": "https://github.com/tamird/sty/blob/0e6aed3cf87fe18936ee8c36762e8085eb668af3/crates/starpls_ide/src/ty/host.rs#L28"
        },
        {
          "label": "Buck2 documents three Starlark environments",
          "url": "https://buck2.build/docs/api/"
        }
      ]
    },
    {
      "id": "investigation:host-buck2-loads",
      "title": "Buck2 cell and data-module loading",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host adaptation not implemented. Reuse Sty’s FileLoader boundary for Buck2 resolution rather than Bazel repository labels. Buck2 cells come from .buckconfig; JSON and TOML can be loaded as modules exporting value. Source lookup, exports and invalidation need the same logical module identity.",
      "nextStep": "Implement a Buck2 loader using cell-relative identities and explicit data-module exports; qualify cross-cell aliases and edits to loaded data.",
      "findings": [],
      "evidence": [
        {
          "label": "Existing module-loader interface",
          "url": "https://github.com/tamird/sty/blob/0e6aed3cf87fe18936ee8c36762e8085eb668af3/crates/starpls_ide/src/lib.rs#L965"
        },
        {
          "label": "Buck2 cells configuration",
          "url": "https://buck2.build/docs/concepts/buckconfig/#cells"
        },
        {
          "label": "Buck2 JSON and TOML module contracts",
          "url": "https://buck2.build/docs/users/loading_data/"
        }
      ]
    },
    {
      "id": "investigation:host-buck2-type-constructors",
      "title": "Buck2 record and enum contracts",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host semantics require qualification. Buck2 exposes record, field and enum constructors alongside namespaced typing values. Map those values through host-supplied semantic contracts instead of assuming Bazel provider or struct behavior. Documentation differs on using record constructors directly versus .type in annotations; settle that against a pinned runtime.",
      "nextStep": "Pin the target Buck2/Starlark runtime, establish constructor and annotation behavior, then qualify field defaults, invalid values and nominal type identity.",
      "findings": [],
      "evidence": [
        {
          "label": "Buck2 record and field API",
          "url": "https://buck2.build/docs/api/starlark/#record"
        },
        {
          "label": "Starlark Rust annotation and constructor semantics",
          "url": "https://github.com/meta/starlark-rust/blob/main/docs/types.md"
        },
        {
          "label": "Current Bazel-specific declaration generation",
          "url": "https://github.com/tamird/sty/blob/0e6aed3cf87fe18936ee8c36762e8085eb668af3/crates/starpls_ide/src/ty/native.rs#L1"
        }
      ]
    },
    {
      "id": "investigation:ty-host-parser",
      "title": "Host parser and semantic file identity",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host-extension design. Expose custom parsing, annotation parsing and literal decoding without changing Python defaults. Preserve namespace-sensitive identities for the same physical file.",
      "nextStep": "Reconcile the public extension boundary with current ty; qualify unchanged Python parsing plus sty comment offsets and host identity.",
      "findings": [
        {
          "text": "Allow explicit grammar in cached Python parses — crates/ruff_db/src/lib.rs, crates/ruff_db/src/parsed.rs, crates/ruff_python_ast/src/lib.rs",
          "evidence": [
            {
              "label": "dbaf2b63ba2a5bdcd51cfb4e0bdbc03cdd3ebda4",
              "url": "https://github.com/tamird/ruff/commit/dbaf2b63ba2a5bdcd51cfb4e0bdbc03cdd3ebda4"
            }
          ]
        },
        {
          "text": "Separate embedded semantic program identities — crates/ty_python_core/src/program.rs, crates/ty_python_core/src/program_file.rs",
          "evidence": [
            {
              "label": "43e2ef185fd950d5965823012b1ed59b15392db0",
              "url": "https://github.com/tamird/ruff/commit/43e2ef185fd950d5965823012b1ed59b15392db0"
            }
          ]
        },
        {
          "text": "Allow embedders to select a module parser — crates/ruff_db/src/lib.rs, crates/ruff_db/src/parsed.rs",
          "evidence": [
            {
              "label": "d441e20a8f9fdefc1ffd75af8f7f430013c232ae",
              "url": "https://github.com/tamird/ruff/commit/d441e20a8f9fdefc1ffd75af8f7f430013c232ae"
            }
          ]
        },
        {
          "text": "Allow embedders to parse detached annotations — crates/ruff_db/src/lib.rs, crates/ruff_db/src/parsed.rs",
          "evidence": [
            {
              "label": "8bb0b9cb0384ffd567841eedfc863e002706e281",
              "url": "https://github.com/tamird/ruff/commit/8bb0b9cb0384ffd567841eedfc863e002706e281"
            }
          ]
        },
        {
          "text": "Parse type parameters at an offset in the source — crates/ruff_python_parser/src/lib.rs, crates/ruff_python_parser/src/parser/mod.rs, crates/ruff_python_parser/src/parser/statement.rs",
          "evidence": [
            {
              "label": "5ec8d1ed1b58f5b57b990daed5a1176130809e4f",
              "url": "https://github.com/tamird/ruff/commit/5ec8d1ed1b58f5b57b990daed5a1176130809e4f"
            }
          ]
        },
        {
          "text": "Use executed source implementation for deprecation and runtime diagnostics. When callable source identity differs from external signature owner, find the source implementation for deprecation and implementation-related diagnostics instead of donor declaration. Next: Keep donor public signature separate from executed defaults/body and source diagnostic locations.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L3817"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Resolve native and detached signature annotations from their actual owner. Signature annotation lookup selects PEP695 parameter scope or deferred function inference using function definition, avoiding detached-node index lookup. SourceAnnotation supplies return/parameter type and flags; external generic contexts retain donor ownership when native PEP695 context is absent. Next: Reuse parser/consumer design ownership and native-over-donor precedence tests.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L80"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-host-contracts",
      "title": "Host-supplied semantic contracts",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host-extension design. Keep reusable extension points separate from Bazel providers, contexts and rule reflection. sty consumes the provided_* database contract; accepting the entire Bazel model into ty is not assumed.",
      "nextStep": "Migrate supplied bindings into the current PlaceLoadResolver owning mechanism introduced by upstream #29791; agree a maintainable host API before proposing it.",
      "findings": [
        {
          "text": "Accept embedded source bindings and builtins — crates/ty_python_core/src/builder.rs, crates/ty_python_core/src/db.rs, crates/ty_python_core/src/definition.rs, crates/ty_python_core/src/lib.rs, crates/ty_python_semantic/src/db.rs, crates/ty_python_semantic/src/lexical_name_path.rs, crates/ty_python_semantic/src/lib.rs, crates/ty_python_semantic/src/place.rs, crates/ty_python_semantic/src/semantic_model.rs, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/context.rs, crates/ty_python_semantic/src/types/definition_resolution.rs, crates/ty_python_semantic/src/types/diagnostic.rs, crates/ty_python_semantic/src/types/generics.rs, crates/ty_python_semantic/src/types/ide_support.rs, crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/imports.rs, crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs, crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs, crates/ty_python_semantic/src/types/provided.rs, crates/ty_python_semantic/src/types/provided/source_tests.rs",
          "evidence": [
            {
              "label": "e7b5ba34b42483c4774dab0f3865592a6d5501cc",
              "url": "https://github.com/tamird/ruff/commit/e7b5ba34b42483c4774dab0f3865592a6d5501cc"
            }
          ]
        },
        {
          "text": "Model embedded factories with ordinary Ty types — crates/ty_python_semantic/resources/mdtest/ide_support/all_members.md, crates/ty_python_semantic/src/db.rs, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/call.rs, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/call/checked.rs, crates/ty_python_semantic/src/types/callable.rs, crates/ty_python_semantic/src/types/class/dynamic_literal.rs, crates/ty_python_semantic/src/types/class/known.rs, crates/ty_python_semantic/src/types/display.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/new_class.rs, crates/ty_python_semantic/src/types/infer/builder/type_call.rs, crates/ty_python_semantic/src/types/instance.rs, crates/ty_python_semantic/src/types/list_members.rs, crates/ty_python_semantic/src/types/provided.rs, crates/ty_python_semantic/src/types/provided/data.rs, crates/ty_python_semantic/src/types/provided/tests.rs, crates/ty_python_semantic/src/types/signatures.rs",
          "evidence": [
            {
              "label": "5078c1f9f0b2f30aa0ecf2b978487410373d7b7d",
              "url": "https://github.com/tamird/ruff/commit/5078c1f9f0b2f30aa0ecf2b978487410373d7b7d"
            }
          ]
        },
        {
          "text": "Share checked calls with native refinements — crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/call.rs, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/call/checked.rs, crates/ty_python_semantic/src/types/class/known.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/function.rs",
          "evidence": [
            {
              "label": "23fa67398bdc5e361bdacd52e4b979131c1aa83f",
              "url": "https://github.com/tamird/ruff/commit/23fa67398bdc5e361bdacd52e4b979131c1aa83f"
            }
          ]
        },
        {
          "text": "Check supplied assignment annotations — crates/ty_python_core/src/db.rs, crates/ty_python_core/src/definition.rs, crates/ty_python_semantic/src/semantic_model.rs, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/diagnostic.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/provided/source_tests.rs",
          "evidence": [
            {
              "label": "45c16c583a0ac6042b0bf49b1296b3bdac746713",
              "url": "https://github.com/tamird/ruff/commit/45c16c583a0ac6042b0bf49b1296b3bdac746713"
            }
          ]
        },
        {
          "text": "Compose generic contexts across semantic namespaces. Generic context merge compares resolver/platform programs with semantic namespaces cleared. Individual TypeVars retain definition/binding identity. Next: Review shared-support-file identity with host API design.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L498"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose specialization construction to embedded consumers. GenericContext.specialize and Specialization.types become public. Documentation removes references to absent helpers. Next: Minimize supported public constructor/accessor contract during host API review.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L1007"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose strict subtype, equivalence, disjointness and pure redundancy queries. Public subtype API documents all-materializations semantics; pure redundancy preserves both materialization bounds and explicitly does not certify inference completeness. Equivalence/disjointness visibility changes expose existing relations. Next: Agree minimal public relation surface and avoid treating reflexive unresolved redundancy as a proof of completeness.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L406"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Check supplied storage on the complete receiver before splitting intersections. Provided-instance targets first check nominal base and supplied field contracts on the entire source receiver. A constituent may provide immutable storage and another may narrow it. Bound TypeVars remain on their specialized bound/constraint path. Next: Require host contract tests for intersection storage plus value narrowing.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L2741"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose per-source checked argument/formal pairs conservatively. input_types specializes/rematches selected overloads, retains alternatives separately and includes downstream constructors. Decline expansion snapshots, incomplete/gradual/ParamSpec signatures, failed matching or unmapped inputs. Actual type uses same expected-type key as contextual inference. Next: API review and native positive/decline cases before host consumers rely on full coverage.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L1094"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Combine supplied getter presence and immutable storage across all viable domains. Supplied getter return/presence contracts refine selected overloads with ordinary error recovery. Immutable storage requires agreement of every matching domain before equal-result pruning; expansion/recovery cannot certify it. Absent yields KNOWN_ABSENT, partial presence remains possibly undefined. Next: Review whole-overload-family proof including ambiguous gradual arguments and expansion.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L1299"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Refine only overload bindings whose snapshots remain complete. Single signatures retain error-recovery bindings. Multiple expansion cases are eligible only with one unique selected overload per successful case; reused overload specializations or limit-reached expansion decline. Recompute expanded/ambiguous returns after application refinement. Equal supplied results collapse only when complete static nonpredicate and all matching declarations agree. Next: Need selected-overload reuse, recovery, gradual ambiguity and every-case result fixtures. Distinguish precise native results from host hook admission.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L4991"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Derive fresh factory keyword context from expected immutable fields. One-signature host-marked keyword factory can derive per-field expected types from readonly protocol properties or guaranteed immutable nominal fields instead of one shared generic value formal. Next: Require host API proof of storage/readonly contracts and independent fields with different types.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L10249"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Supply contextual unannotated parameter views without changing declarations. with_inferred_parameter_context maps only ordinary inferred parameters with canonical source definitions. Authored/native/external annotations, variadics, defaults and return remain; resulting view does not certify that callers inhabit that domain. Next: Require explicit host domain guarantee at consumer.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L3257"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Represent incomplete parameter descriptions separately from gradual types. Incomplete rows admit ordinary per-row call checks but cannot prove unseen required input domains in strict callable relations. Incomplete survives prefix/transformation/ParamSpec expansion, and materialization uses conservative global bounds rather than erasing unknown shape through value mapping. Next: Public constructor requires normalized standard rows. Test missing unseen required inputs, bottom/top and mixed gradual parameters before API proposal.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L4530"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose minimal signature and parameter constructors/accessors. Visibility and must_use changes expose normalized signature creation, parameter rows, kinds/names/default presence, generic flag, and immutable return/parameter transformations. Constructors share one initialization helper. Next: Review minimal stable surface rather than mechanically exposing every internal.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L1199"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose matched call facts without requesting enclosing completed inference. CheckedCall holds original AST/source file, current argument and child type facts, binding errors and return. Context providers may receive provisional checks; final result providers receive completed call checks. Applications inspect read-only; native refinements alone mutate result. Next: Full file already reviewed in class-call-context inventory.",
          "evidence": [
            {
              "label": "types/call/checked.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Distinguish omitted, definitely supplied and indeterminate matched parameters. Parameter lookup uses exact matcher mapping including synthetic receiver offset. Multiple source suppliers, starred positional unpacking, optional unpacked keys or missing types are indeterminate. Definite unpacked keyword values have no individual AST expression. Next: Keep optional pack, duplicate supplier, synthetic receiver and omitted default negative cases.",
          "evidence": [
            {
              "label": "types/call/checked.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Distinguish dictionary child evaluation from call-time argument observation. dictionary_items observes when a child was evaluated; dictionary_argument observes after all arguments evaluate, selecting actual/unpacked keyword access. Optional/residual entries do not prove key presence; receiver dictionaries and ambiguous variadic key names decline. TypedDict fallback preserves source range. Next: Tests must demonstrate later argument mutation changes call-time snapshot without rewriting child-time observation.",
          "evidence": [
            {
              "label": "types/call/checked.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Infer one anchored detached annotation only during final refinement. infer_annotation_at delegates an optional provider with a canonical child expression owner and at most one same-file detached range. Provisional checks have no provider and return None. Next: Retain anchor identity, diagnostics and provisional absence tests.",
          "evidence": [
            {
              "label": "types/call/checked.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain complete original keyword node for native diagnostics. argument_node returns complete keyword including its name, not only value expression. Native static_assert keyword fixture checks secondary annotation range over condition=False. Next: Run the native keyword diagnostic regression and check upstream source-range behavior.",
          "evidence": [
            {
              "label": "types/call/checked.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Upstream PlaceLoadResolver refactor #29791",
          "url": "https://github.com/astral-sh/ruff/pull/29791"
        }
      ]
    },
    {
      "id": "investigation:ty-selected-toolchain-fields",
      "title": "Selected toolchain fields and indexed host bounds",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host API design. Apple lipo still lacks a static ToolchainInfo field contract. An RBE aspect/cquery probe follows the selected producer, field shape and configured dependency edge through an --extra_toolchains replacement. Producer bodies remain unchecked.",
      "nextStep": "Check selected producer bodies and handle multiple configurations without label-only joins before adding keyed host bounds. Universal source contracts still require an enforced ABI. Sty integration is not implemented.",
      "findings": [
        {
          "text": "The existing subscript result-bound hook receives a file and receiver, but no index. Per-toolchain results need the inferred key as well. — crates/ty_python_semantic/src/db.rs, crates/ty_python_semantic/src/types/infer/builder/subscript.rs",
          "evidence": [
            {
              "label": "ec5ee4693e7c1cf9a4ba432e3b0f4d494e89b805",
              "url": "https://github.com/tamird/ruff/commit/ec5ee4693e7c1cf9a4ba432e3b0f4d494e89b805"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Bazel 9.3.1 selected-toolchain replacement probe",
          "url": "https://app.buildbuddy.io/invocation/d9603257-a7df-4706-a3ce-254d442e9b86"
        },
        {
          "label": "Bazel 9.3 aspect toolchain access",
          "url": "https://github.com/bazelbuild/bazel/blob/9.3.0/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/platform/ToolchainContextApi.java#L43"
        },
        {
          "label": "Bazel 9.3 wildcard toolchain propagation",
          "url": "https://github.com/bazelbuild/bazel/blob/9.3.0/src/main/java/com/google/devtools/build/lib/packages/AspectPropagationEdgesSupplier.java#L226"
        }
      ]
    },
    {
      "id": "investigation:ty-dictionary-flow",
      "title": "Dictionary observations and flow precision",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Track allocation contents, indexed writes, membership guards and finite keyword schemas. Overlaps the local and conditional keyword dictionary work already in upstream review.",
      "nextStep": "Compare current upstream and PRs29138/29141/29186, isolate remaining Python regressions, then port through shared index/inference machinery.",
      "findings": [
        {
          "text": "Move dictionary observations out of call checking — crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/call.rs, crates/ty_python_semantic/src/types/call/arguments.rs, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/call/checked.rs, crates/ty_python_semantic/src/types/dictionary.rs, crates/ty_python_semantic/src/types/typed_dict.rs",
          "evidence": [
            {
              "label": "956ddb3c7cd4f1e55d6e83e315c5553e5cd42532",
              "url": "https://github.com/tamird/ruff/commit/956ddb3c7cd4f1e55d6e83e315c5553e5cd42532"
            }
          ]
        },
        {
          "text": "Track dictionary contents through control flow — crates/ty_python_core/src/builder.rs, crates/ty_python_core/src/builder/dictionary_contents.rs, crates/ty_python_core/src/builder/loop_bindings_visitor.rs, crates/ty_python_core/src/definition.rs, crates/ty_python_core/src/lib.rs, crates/ty_python_core/src/member.rs, crates/ty_python_core/src/place.rs, crates/ty_python_core/src/symbol.rs, crates/ty_python_core/src/use_def.rs, crates/ty_python_core/src/use_def/place_state.rs, crates/ty_python_semantic/resources/mdtest/call/dictionary_contents.md, crates/ty_python_semantic/resources/mdtest/call/local_dictionary_unpacking.md, crates/ty_python_semantic/src/lexical_name_path.rs, crates/ty_python_semantic/src/place.rs, crates/ty_python_semantic/src/semantic_model.rs, crates/ty_python_semantic/src/types/call/arguments.rs, crates/ty_python_semantic/src/types/diagnostic.rs, crates/ty_python_semantic/src/types/dictionary.rs, crates/ty_python_semantic/src/types/dictionary/contents.rs, crates/ty_python_semantic/src/types/ide_support.rs, crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs, crates/ty_python_semantic/src/types/infer.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs, crates/ty_python_semantic/src/types/narrow.rs, crates/ty_python_semantic/src/types/provided/tests.rs",
          "evidence": [
            {
              "label": "74d28cc028a02fa315e40b6c368b62e73beaf794",
              "url": "https://github.com/tamird/ruff/commit/74d28cc028a02fa315e40b6c368b62e73beaf794"
            }
          ]
        },
        {
          "text": "[ty] Move dictionary inventory joining to DictionaryItems — crates/ty_python_semantic/src/types/dictionary.rs, crates/ty_python_semantic/src/types/dictionary/contents.rs",
          "evidence": [
            {
              "label": "08fb15feb45a15b7b23091ab529d5c18944d3ca4",
              "url": "https://github.com/tamird/ruff/commit/08fb15feb45a15b7b23091ab529d5c18944d3ca4"
            }
          ]
        },
        {
          "text": "[ty] Accept immediately guarded dictionary reads — crates/ty_python_semantic/resources/mdtest/narrow/conditionals/in.md, crates/ty_python_semantic/src/types/dictionary.rs, crates/ty_python_semantic/src/types/infer/builder/subscript.rs, crates/ty_python_semantic/src/types/subscript.rs",
          "evidence": [
            {
              "label": "352ce32f76a8416551cb72d66dfa4f6d75a7c7e9",
              "url": "https://github.com/tamird/ruff/commit/352ce32f76a8416551cb72d66dfa4f6d75a7c7e9"
            }
          ]
        },
        {
          "text": "Combine successful keyword sources without dictionary overlay semantics. collect_keyword_items combines observed keyword sources. Named-key collisions decline metadata and leave diagnostics to ordinary matching; required named entries constrain residual collisions on successful paths. Optional entries combine residual value types. The combined synthetic evidence cannot claim runtime first-entry order. Next: Extract with duplicate explicit/unpacked/optional/open keyword source cases and negative diagnostic preservation.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L36"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Keep optional observed keys from suppressing later possible pack values. Parameter metadata distinguishes may-be-matched from skip_unknown_keywords. Required/optional/unspecified presence is carried through assignment and MatchedParameter. Later unknown packs still check parameters previously touched only by optional keys; matching_keyword centralizes named/variadic resolution. Next: Use optional key followed by differently typed residual pack, required slot and duplicate source cases.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L5680"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Report independently replaceable partial keywords by name. Known keyword sources in partial application carry UnpackedKeyword(name) provenance so separate stored keys can be independently overridden even when matching one **kwargs formal. Next: Reduce multiple stored keyword keys with one replacement.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L5913"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Reject unchecked callback keyword surfaces explicitly. If otherwise error-free inference cannot verify a complete keyword ParamSpec witness, add UnverifiedKeywordProjection and report invalid argument type; participates in overload resolution and partial-application filtering. Next: Check budget exhaustion remains an explicit verification failure and ordinary valid calls avoid false errors.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L8996"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Check observed pack entries through matched variadic evidence. Observed keyword packs use already matched per-entry argument evidence during variadic type checking instead of re-deriving one homogeneous mapping value type. Next: Retain mixed per-key value and residual keyword tests.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L9250"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve captured keyword identity through key iteration. Fork dictionary observation policy with ordinary Python ParamSpec behavior. Next: Retain callee/other-argument/alias/closure-mutation exposure controls and establish upstream owner boundary before proposing extraction. Reconcile the preserved Observed keyword-prefix exclusions with upstream #30594 shared argument selection; this migration is not another independent contribution.",
          "evidence": [
            {
              "label": "dictionary/contents.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/dictionary/contents.rs#L1639",
              "blob": "f2dae47eace1122d52e881e45d37c4a1e6bb2fb2"
            },
            {
              "label": "Observed keyword-prefix exclusions",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/arguments.rs#L551",
              "blob": "fb68ab5c18565ce7ab3cc09921cb8d4956e52a5f"
            },
            {
              "label": "Shared selector integrated with observed keywords",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L9940",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Validate observed keyword mapping keys before unpacking. Fork dictionary-observation integration correction; upstream extraction must preserve ordinary keyword-unpack validation. Next: Keep this correction with the dictionary-observation extraction; preserve non-string key, TypedDict, ParamSpec and residual-key controls before requesting Tamir review.",
          "evidence": [
            {
              "label": "Validate keys before the unpack early return",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L9403",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Existing nested non-string key rejection",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/call/local_dictionary_unpacking.md#L206",
              "blob": "0e05200de1756e67995e1e5bdde514127b60d357"
            },
            {
              "label": "Existing copied non-string key rejection",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/call/local_dictionary_unpacking.md#L328",
              "blob": "0e05200de1756e67995e1e5bdde514127b60d357"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Observe tracked mapping arguments after evaluation. Dictionary observation integration correction using the existing snapshot recorder. Next: Keep positional/named timing, alias/rebinding, mutation and identity guards together; preserve precise empty/update observations and measure snapshot retention before upstream extraction.",
          "evidence": [
            {
              "label": "Shared after-all-arguments recorder",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_core/src/builder/dictionary_contents.rs#L474",
              "blob": "9bf157bf4d035a9b7b886f07235ba2fa7dbc100c"
            },
            {
              "label": "Mutation, rebinding and ordinary/named controls",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/provided/tests.rs#L4321",
              "blob": "92d24415701b0c5d89140ad2a4d4864b570c4440"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Preserve fresh mapping fields across exact string concatenation. Literal precision and dictionary-recovery integration; existing exact-runtime-class owner supplies dispatch proof. Next: Extract with dictionary recovery, retain open/custom-final/reflected/nested-call refusal and LiteralString subclass controls; identify an upstream consumer before requesting Tamir review.",
          "evidence": [
            {
              "label": "Exact builtin identity plus existing runtime-class proof",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/dictionary/contents.rs#L1289",
              "blob": "f2dae47eace1122d52e881e45d37c4a1e6bb2fb2"
            },
            {
              "label": "Operand proof and recursive child traversal",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/dictionary/contents.rs#L1256",
              "blob": "f2dae47eace1122d52e881e45d37c4a1e6bb2fb2"
            },
            {
              "label": "Ordinary/final subclasses do not satisfy LiteralString",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/annotations/literal_string.md#L425",
              "blob": "a9eb51fe99ae9060fc347f156842c8f2eee75d09"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Upstream overlapping design #29138",
          "url": "https://github.com/astral-sh/ruff/pull/29138"
        },
        {
          "label": "Upstream overlapping design #29141",
          "url": "https://github.com/astral-sh/ruff/pull/29141"
        },
        {
          "label": "Upstream overlapping design #29186",
          "url": "https://github.com/astral-sh/ruff/pull/29186"
        }
      ]
    },
    {
      "id": "investigation:ty-solver-inference",
      "title": "Solver and callable generic inference",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. General constraint solving, callable/generic inference and type-variable improvements need separate Python regressions before porting. The existing LLVM callback case with a fresh list of \"ok\" and list[Literal[\"ok\"]] fails on the fork and pristine upstream. A fix passes the strengthened existing fixture; broader qualification is in progress.",
      "nextStep": "Finish qualification of the fresh-literal callback fix, including the actual LLVM corpus case, before preparing an upstream proposal. Continue isolating the remaining solver improvements.",
      "findings": [
        {
          "text": "[ty] Isolate inference for call candidates — crates/ty_python_semantic/resources/mdtest/call/union.md, crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md, crates/ty_python_semantic/resources/mdtest/generics/legacy/paramspec.md, crates/ty_python_semantic/resources/mdtest/generics/pep695/classes.md, crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md, crates/ty_python_semantic/src/types/call/bind.rs",
          "evidence": [
            {
              "label": "b49d6ea5e7727b10015e87e3a8e2584b1d59560b",
              "url": "https://github.com/tamird/ruff/commit/b49d6ea5e7727b10015e87e3a8e2584b1d59560b"
            }
          ]
        },
        {
          "text": "[ty] Separate atomic constraint operations — crates/ty_python_semantic/src/types/constraints/sequents.rs, crates/ty_python_semantic/src/types/constraints/variables.rs",
          "evidence": [
            {
              "label": "5becae77b1455155940db1570e93be80f40a270a",
              "url": "https://github.com/tamird/ruff/commit/5becae77b1455155940db1570e93be80f40a270a"
            }
          ]
        },
        {
          "text": "[ty] Group solver bounds by type variable — crates/ty_python_semantic/resources/mdtest/type_properties/materialization.md, crates/ty_python_semantic/src/types/constraints.rs, crates/ty_python_semantic/src/types/constraints/solutions.rs",
          "evidence": [
            {
              "label": "bfd71700b5ff0922f3e570c79ba866098e567368",
              "url": "https://github.com/tamird/ruff/commit/bfd71700b5ff0922f3e570c79ba866098e567368"
            }
          ]
        },
        {
          "text": "Preserve generics through pending narrowing — crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md, crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md, crates/ty_python_semantic/src/types/generics.rs, crates/ty_python_semantic/src/types/ide_support/unreachable_code.rs",
          "evidence": [
            {
              "label": "18bf8b414cd2e2387f4a201cc8681a19211751f6",
              "url": "https://github.com/tamird/ruff/commit/18bf8b414cd2e2387f4a201cc8681a19211751f6"
            }
          ]
        },
        {
          "text": "Imports, storage size derivation and shared helper plumbing. Imports and storage-size derives support the identified graph and solver mechanisms; no independently claimed Python behavior. Next: Carry only with the owning mechanism.",
          "evidence": [
            {
              "label": "types/constraints/variables.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L4"
            },
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L14"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Rename attribute stripping to projection-family base. Calls formerly stripping P.args/P.kwargs now recover the ParamSpec base, covering newly added keyword projections as well. Next: Include the migration with keyword projection design.",
          "evidence": [
            {
              "label": "types/cyclic.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/cyclic.rs#L333"
            },
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L582"
            },
            {
              "label": "types/typevar.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1325"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Rename budget-exceeded paths to incomplete paths. Consumer matches the broader Incomplete path state rather than a budget-only label. Next: Include the migration with incomplete-projection behavior.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L5237"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Exclude consumed prefix names from forwarded ParamSpec tails. Prefix projection removes known entries consumed by prefix parameters and separately records their names so an open/residual tail cannot supply them again. P.kwargs and captured keyword argument components share the appropriate consumer. Next: Native residual_keywords_follow_paramspec_projection assertion body read.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L674"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Use shared dictionary presence enum. Required key booleans become DictionaryItemKind::Required, matching shared observed keyword presence semantics. Next: Carry with keyword observation implementation.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L916"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Exercise operand preservation, context admission and residual forwarding. The mixed module-boundary hunk adds complete assertion bodies for unspecialized nominal context; literal children retain fixed tuple slots even when source operand is Unknown/Divergent/missing; residual prefix exclusion preserves forwarding type checks. Next: Run the native argument evidence regressions on the proposed source.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L1410"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Read owned graph source immutably. Marking helpers accept immutable storage after the source-order/snapshot refactor. Next: Keep with ownership refactor.",
          "evidence": [
            {
              "label": "types/constraints/owned.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/owned.rs#L25"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Imports and unchanged redundancy-match formatting. Imports support protocol unions and supplied receivers; redundancy match is only reformatted. Next: Carry with owning change.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L6"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Move atomic-only traversal out of PathAssignments. The prior recursive three-edge visitor panicked on non-atomic nodes. It is removed as quantified-aware traversal moves to solution/walker owners, which remain to be semantically attributed. Removal itself is not proof of equivalent callback/fuel/terminal behavior. Next: Keep unresolved compatibility gate until replacement traversal and ordinary terminal budget behavior are read and qualified.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L254"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Use relation-capable sequent aliases and trigger tables. Alias/field names, cached relation payload types and return signatures migrate to shared PathSequent. Trigger naming now covers both antecedents and negated consequences. Next: Carry with corresponding proof changes.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L6"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Imports for scoped proof and residual ownership. Imports only; mechanism ownership is documented separately. Next: Carry with owning implementation.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Do not let nominal FunctionType.__call__ bypass precise callable inputs. Remove a generic gradual FunctionType.__call__ binding when another callable constituent supplies the same function signature. Recognition checks actual known class method and gradual return/parameter surface. Next: Coordinate the generic nominal FunctionType proposal.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L868"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Do not eliminate overloads using unresolved parameter domains. Top-materialized argument overload filtering requires parameter types contain no Divergent before proving assignability. Next: Compare finite-signature lambda foundation and native recursive overload tests before extraction.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L4846"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve explicit TypedDict extra-item call rules after observation. Observed contents refine keys but explicit TypedDict extras remain stricter than ordinary mapping: unknown names require **kwargs and cannot fill required named parameters. Excluded forwarded prefixes are represented as Never residual entries; source field definition locations survive. Next: Separate declared-schema call policy from observed runtime precision.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L6124"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Use domain-aware ParamSpec projections consistently. Domain checks distinguish parameter-signature variables from keyword dictionaries; unpack/type checking/context forwarding accepts P.kwargs or captured argument projections as appropriate. Preserve provisional/final mode through forwarded signature inference. Next: Carry with projection producer.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L275"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Defer recursive generic return inference only on otherwise valid argument evidence. CallInference retains binding error state and permits shared-placeholder return deferral only without binding/specialization/constraint failures; alternate complete solution path explicitly disables deferral. Next: Coordinate #29553 finite lambda source identity and isolate non-host recursive call reproducer.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L7002"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Include synthesized protocol fields in inferred return variance. Return variance traversal explicitly handles protocols without nominal origin by composing structural field variance; named nominal protocols retain specialization traversal. Next: Use a structural callback/interface returned through generic inference.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L8088"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Keep caller receiver and argument domains fixed during callee substitution. Ordinary synthetic bound-method receivers are caller values and are not rewritten by callee inference. Explicit argument substitution preserves retained caller TypeVar domains; constructor receiver templates retain their own inference path. TypeVarTuple evidence uses the same argument-specific mapping. Next: Native bounded caller TypeVar and ordinary receiver vs constructor regressions.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L8430"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose source-overload and match mapping helpers. Return methods receive db/env arguments; inferable constructor class context records matching owner; selected source overload index and bound receiver match offsets support checked input/editor consumers. Next: Carry with owner contracts.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L346"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Imports for actual call mechanisms. Imports only; no independent semantic claim. Next: Carry with owning units.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L31"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Capture callee Self while retaining the original receiver parameter contract. apply_self_for_call maps exactly the signature-owned Self binder and keeps caller-introduced receiver domains intact. Only remaining parameters/result use captured Self; first parameter remains original for ordinary call checking. Shared apply_self_mapping helper accepts either explicit binder substitution or binding-context mapping. Next: Reduce explicit self annotation, inherited generic receiver and caller Self cases.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L656"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expand resolved ParamSpec rows before checked argument rematching. specialize_for_call applies selected mapping then expands ordinary or keyword-capture variadics into final slots for exact checked input mapping. Next: Keep unsupported/incomplete decline behavior and source argument offsets tested.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L2637"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Share existing positional parameter tuple construction. Move tuple/TypeVarTuple segment construction from callable ParamSpec relation to helper reused by lambda variadic context. Next: Carry with lambda context behavior.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L5454"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Build keyword dictionary shapes from normalized parameter rows. keyword_arguments_type maps defaults to optional key presence, not inserted default values; empty complete rows make a closed empty dictionary. Ordinary open tails become extra items. A symbolic keyword component is a whole dictionary and cannot silently combine with fixed fields; readonly accepted surface and writable captured arguments are distinct. Next: Specify supplied host shape API separately.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L5936"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Share named-or-variadic keyword parameter lookup. matching_keyword factors existing keyword_by_name or keyword_variadic sequence for argument matcher. Next: Carry with matching behavior.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7106"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Imports for signature source ownership and solver mechanisms. Imports only; no standalone semantic claim. Next: Carry with corresponding changes.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L14"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve concrete structure while overload returns are provisional. General Python candidate; built on existing divergent/cycle representation. Next: Extract minimal upstream reproducer and retain settled ambiguity, bare pending/materialized marker and foreign-cycle controls.",
          "evidence": [
            {
              "label": "call/ambiguous.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/ambiguous.rs#L18",
              "blob": "36154f80fcd011cc7d5d8e9b0649f475b6546770"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Retain closed filters during recursive union resolution. Solver enhancement dependent on fork merged-solution owner. Next: Separate positive closed filters, negative closed filters and shared resource accounting; preserve rejection of inferable complements, unsupported dependencies and growing container cycles.",
          "evidence": [
            {
              "label": "constraints/resolution.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/constraints/resolution.rs#L190",
              "blob": "1692aa7e20f3b53295b3e6036a472ba3439cc748"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Preserve generic candidates until full expansion. General Python ParamSpec/Concatenate inference candidate. Next: Preserve source-signature inferables and bounded Lazy precheck; inconclusive proof must retain full expansion and final all-overload validation.",
          "evidence": [
            {
              "label": "call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L4557",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Preserve constrained caller witnesses in callbacks. General Python fork regression fix; original bidirectional evidence, caller domain proof and full correlated path validation are all required. Next: Retain compatible/open/wrong callback controls and original-evidence, mixed/concrete, domain, provisional and incomplete refusals; upstream extraction must preserve the existing scoped-family solver owner.",
          "evidence": [
            {
              "label": "Original lower/upper equality certificate",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/constraints.rs#L3547",
              "blob": "88576e91defcda500d7cf02525314f321fa8d438"
            },
            {
              "label": "Caller domain proof before single-alternative family retention",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/constraints/solutions.rs#L2182",
              "blob": "62ea11eb60d205c383c77ba131c2c5c90c1b9b78"
            },
            {
              "label": "Maintained callback correlation regression",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md#L6271",
              "blob": "bb437c45046408d685777e1ab3ad604f09457295"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Prove strict callbacks with fixed constrained callers. General Python strict callable relation; reuses bounded complete-source substitution and whole-signature replay, without changing Sty strictness or target-variable ownership. Next: Preserve rigid bounded/constrained caller controls in both syntax styles, shared-witness/Any negatives and incomplete refusal; qualify extraction with actual strict host consumers and existing recursive relation controls.",
          "evidence": [
            {
              "label": "Narrow original-LazyStatic false relation fallback",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/signatures.rs#L3868",
              "blob": "5d19725f68178456e30b4637a117f00c5238de79"
            },
            {
              "label": "Legacy caller domains and invariant negatives",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/generics/legacy/callables.md#L2244",
              "blob": "e6f703efc6136a6dd2813353a2e10f480b19363e"
            },
            {
              "label": "PEP695 caller domains and invariant negatives",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/generics/pep695/callables.md#L2172",
              "blob": "b9ea1a0d0892980e03e6bb769645488bfd05f9ca"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Pristine upstream literal-callback failure",
          "url": "https://app.buildbuddy.io/invocation/807642d3-cc5a-4840-af59-3be7eb523295"
        }
      ]
    },
    {
      "id": "investigation:ty-overload-bodies",
      "title": "Annotated overload implementation analysis",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Sty now pairs overloaded interfaces with checked source bodies and uses the same finite domains for strictness. General Python body-domain analysis still needs an upstream split and review.",
      "nextStep": "Repair with_cfg dictionary-union admission and the fork-only generic callback rejection; compare the remaining body-domain APIs with upstream.",
      "findings": [
        {
          "text": "[ty] Prototype overload body domains — crates/ty_python_semantic/src/place.rs, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/context.rs, crates/ty_python_semantic/src/types/infer.rs, crates/ty_python_semantic/src/types/infer/body_domain.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/function.rs",
          "evidence": [
            {
              "label": "a8439ae9f7959c5ad2c82fb6a06180f8735839fa",
              "url": "https://github.com/tamird/ruff/commit/a8439ae9f7959c5ad2c82fb6a06180f8735839fa"
            }
          ]
        },
        {
          "text": "[ty] Use complete overload body analysis — crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/context.rs, crates/ty_python_semantic/src/types/diagnostic.rs, crates/ty_python_semantic/src/types/ide_support.rs, crates/ty_python_semantic/src/types/infer.rs, crates/ty_python_semantic/src/types/infer/body_domain.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/annotation_expression.rs, crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs, crates/ty_python_semantic/src/types/string_annotation.rs",
          "evidence": [
            {
              "label": "07b86b2901fc89973eb4ee226dc1694e6b549fa6",
              "url": "https://github.com/tamird/ruff/commit/07b86b2901fc89973eb4ee226dc1694e6b549fa6"
            }
          ]
        },
        {
          "text": "Use declared overloads for annotated implementations — crates/ty_python_semantic/src/types/function.rs, crates/ty_python_semantic/src/types/provided/source_tests.rs, crates/ty_python_semantic/src/types/string_annotation.rs",
          "evidence": [
            {
              "label": "4b54a19d0cb52d081ba052fee443450a2dcaa904",
              "url": "https://github.com/tamird/ruff/commit/4b54a19d0cb52d081ba052fee443450a2dcaa904"
            }
          ]
        },
        {
          "text": "Carry checked overload domains through dictionary comprehensions. Opt-in host body-domain API; lexical dictionary comprehension scope plus canonical dictionary/TypedDict receiver evidence. General Python overload inference is unchanged. Next: Extract host API with per-overload identity, first-iterator scope, shadowing/freshness and every receiver component checked. Actual with_cfg root strict passes only with the separate caller-witness and strict-signature repairs; this source audit grants no runtime qualification.",
          "evidence": [
            {
              "label": "Lexical dictionary comprehension scope boundary",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/body_domain.rs#L302",
              "blob": "d6e9bbb074e893cf0586ada96f668dce38f60cc8"
            },
            {
              "label": "Per-domain scope and callback-input native controls",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/body_domain.rs#L1475",
              "blob": "d6e9bbb074e893cf0586ada96f668dce38f60cc8"
            },
            {
              "label": "Domain-keyed scope query routing",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer.rs#L834",
              "blob": "5c0f11102d29947d81b58786d0e335164a042721"
            },
            {
              "label": "Union/intersection canonical method proof",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/body_domain.rs#L893",
              "blob": "d6e9bbb074e893cf0586ada96f668dce38f60cc8"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Restored checked Starlark interfaces",
          "url": "https://github.com/tamird/sty/commit/9f8e3aa"
        },
        {
          "label": "Historical removal of Starlark overload support",
          "url": "https://github.com/tamird/sty/commit/5960a4bda9c70ea815747b4ab3a5c35c6fdd0bcf"
        },
        {
          "label": "Current body-domain test exercises upstream reachability checkpoints",
          "url": "https://github.com/tamird/ruff/blob/afbd0d25a528ccdfb782a8985316128a7cccf7e3/crates/ty_python_semantic/src/types/infer/body_domain.rs#L2760"
        },
        {
          "label": "Upstream statement-call checkpoint implementation",
          "url": "https://github.com/astral-sh/ruff/pull/30561"
        }
      ]
    },
    {
      "id": "investigation:ty-saved-tag-narrowing",
      "title": "Saved conditions and tagged-union narrowing",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Type-test results saved in values and tagged dictionary unions retain useful branch facts. Separate general Python flow improvements from Starlark type() string semantics.",
      "nextStep": "Reject global guard removal: full upstream Markdown has 24 new failing fixtures and current project checks add diagnostics. Fix the original string-splitting bug without discarding internal guards. Saved runtime type tests and tagged-union mechanisms still need separate reconciliation.",
      "findings": [
        {
          "text": "[ty] Narrow through saved runtime type tests — crates/ty_python_core/src/builder.rs, crates/ty_python_core/src/use_def.rs, crates/ty_python_semantic/resources/mdtest/narrow/type.md, crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs, crates/ty_python_semantic/src/types/narrow.rs, crates/ty_python_semantic/src/types/provided/tests.rs",
          "evidence": [
            {
              "label": "ca48a9779386a7e0ee171e99e57e5c7c8f5d738b",
              "url": "https://github.com/tamird/ruff/commit/ca48a9779386a7e0ee171e99e57e5c7c8f5d738b"
            }
          ]
        },
        {
          "text": "[ty] Narrow unions through saved attribute tags — crates/ty_python_core/src/builder.rs, crates/ty_python_semantic/resources/mdtest/narrow/aliased_conditions.md, crates/ty_python_semantic/src/types/narrow.rs",
          "evidence": [
            {
              "label": "fd259774b672dd8d5f1e500d4eb89c1a5e716c43",
              "url": "https://github.com/tamird/ruff/commit/fd259774b672dd8d5f1e500d4eb89c1a5e716c43"
            }
          ]
        },
        {
          "text": "Narrow tagged unions through saved subscripts — crates/ty_python_core/src/builder.rs, crates/ty_python_semantic/resources/mdtest/narrow/aliased_conditions.md, crates/ty_python_semantic/src/types/narrow.rs",
          "evidence": [
            {
              "label": "ea11b62358b4197de3bcbf8b0e2497aeeff71cf5",
              "url": "https://github.com/tamird/ruff/commit/ea11b62358b4197de3bcbf8b0e2497aeeff71cf5"
            }
          ]
        },
        {
          "text": "Prove impossible native type-tag comparisons. Host type-test contract enhancement within the existing saved-tag narrowing owner; ordinary Python exact-class comparisons retain their existing semantics. Next: Separate the registered-host contract from generic disjointness proof, retain bounded refusal and reflected/open/overlapping-domain controls, then establish an upstream owner and overlap before requesting Tamir review.",
          "evidence": [
            {
              "label": "Bounded native tag impossibility owner",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/narrow.rs#L272",
              "blob": "f08f563acd3b82a1f0bc238ad8df1f4bd2d9d9a4"
            },
            {
              "label": "Comparison inference consumes cached operands",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder.rs#L13851",
              "blob": "c113fadc12f327faf94a2bf522bb476c8f374353"
            },
            {
              "label": "Positive and fail-closed native contract controls",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/provided/tests.rs#L3197",
              "blob": "92d24415701b0c5d89140ad2a4d4864b570c4440"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Eliminate contradictory guards for exact immutable builtins. Existing exact immutable contradiction proof retained. The rejected a0 global leftover-guard stripping policy is absent from this guard-preserving checkpoint. Next: Preserve open builtin, mutable/stateful and custom-final refusals in any upstream extraction. Reconcile future #27106 proposals separately; the rejected global guard-stripping policy is absent. Host/default promotion remains separate from native source receipts.",
          "evidence": [
            {
              "label": "Stable builtin taxonomy requires exact runtime proof",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/class/known.rs#L321",
              "blob": "9a8cfa890cc1a6489288418208a86ae7a4ffcd29"
            },
            {
              "label": "Original exact immutable contradiction proof remains",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/set_theoretic/builder.rs#L2683",
              "blob": "ad83d83b7183a271940b764bec5fc4e8a530146f"
            },
            {
              "label": "Open int subclass stays conservative",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/narrow/truthiness.md#L227",
              "blob": "0dcf02e94774eb1bec898029670fcb3db9ef0e88"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Unqualified global prototype and revised comments",
          "url": "https://github.com/tamird/ruff/commit/7b813717d3098e237cf8beb97eb5f046bf6230bc"
        },
        {
          "label": "Core, semantic, IDE, format, Clippy and four Markdown fixtures pass",
          "url": "https://app.buildbuddy.io/invocation/f2220608-b748-4af2-8b82-ecd4f5d98750"
        },
        {
          "label": "Related proposal drops required truthiness guards",
          "url": "https://github.com/astral-sh/ruff/pull/27106"
        },
        {
          "label": "Composition check reproduces range | str false positive",
          "url": "https://app.buildbuddy.io/invocation/a35b07c9-e754-4b32-a922-9afd35d10364"
        }
      ]
    },
    {
      "id": "investigation:ty-contextual-empty",
      "title": "Contextual empty collection inference",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Empty collection defaults and call arguments can require expected-type context; the merged empty-peer change is a template, not proof this whole unit is upstream. The fresh-literal callback fix is now qualified in the fork and passes the actual LLVM corpus case. The expanded official port covers both bounded and unbounded type variables and passes native suites and all 532 default Markdown fixtures. The fork backport passes the current corpus. The official port is withheld after benchmarks found material inference overhead; a correction must preserve required return precision.",
      "nextStep": "Find a smaller callback-inference change that preserves the shared-TypeVar TypedDict case, then measure it on current upstream. Keep the stored-collection overlap with #27665 separate.",
      "findings": [
        {
          "text": "Infer nonempty collection branches first; this lineage is already upstream in #29131, so subtract it before identifying remaining work — crates/ty_python_semantic/resources/mdtest/conditional/if_expression.md, crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "604759e7cb541d2d2c1443c2d6f00ee987e4c4a9",
              "url": "https://github.com/tamird/ruff/commit/604759e7cb541d2d2c1443c2d6f00ee987e4c4a9"
            }
          ]
        },
        {
          "text": "[ty] Preserve empty collection context — crates/ty_python_semantic/resources/mdtest/bidirectional.md, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "c58c6ae7d2ff11d9ff1311140f97a52da4c30fde",
              "url": "https://github.com/tamird/ruff/commit/c58c6ae7d2ff11d9ff1311140f97a52da4c30fde"
            }
          ]
        },
        {
          "text": "[ty] Use return types for empty dictionaries — crates/ty_python_semantic/resources/mdtest/bidirectional.md, crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "372b2fc678e8190c0188bc0a399e71a413a4446d",
              "url": "https://github.com/tamird/ruff/commit/372b2fc678e8190c0188bc0a399e71a413a4446d"
            }
          ]
        },
        {
          "text": "Replay fresh empty getattr defaults after sibling inference. Existing builtin finite-lookup context scheduling; general Python candidate with separate host integration evidence. Next: Retain fresh-empty/matched-builtin eligibility, bounded context convergence, heterogeneous defaults and final actual-call checks; qualify any extraction on its exact upstream base.",
          "evidence": [
            {
              "label": "Shared matched builtin default eligibility",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L10251",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Sibling-dependent replay and bounded context equality",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder.rs#L6322",
              "blob": "c113fadc12f327faf94a2bf522bb476c8f374353"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        },
        {
          "text": "Infer compatible fresh collection context from reusable sibling evidence. Tentative sibling context with result compatibility fallback, prepared ordered argument evidence and complete-only bounded-retention projection reuse; authoritative supplied-field context remains separate. Next: Keep ba712 on hold pending a design that preserves independently declared donor evidence inside fresh displays and final validation; the current proposal assessment records the source-derived limitation. Coordinate overlap with #27665.",
          "evidence": [
            {
              "label": "Complete sibling-only inference with reusable prepared evidence",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L10844",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Fresh display/comprehension eligibility",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder.rs#L7021",
              "blob": "c113fadc12f327faf94a2bf522bb476c8f374353"
            },
            {
              "label": "Maintained callback literal result and same-kind rejection (PEP695; paired legacy coverage)",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md#L157",
              "blob": "bb437c45046408d685777e1ab3ad604f09457295"
            },
            {
              "label": "Tentative preference retains ordinary fallback provenance",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L9766",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Actual fresh result compatibility selects inference branch",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder.rs#L7045",
              "blob": "c113fadc12f327faf94a2bf522bb476c8f374353"
            },
            {
              "label": "Authoritative supplied readonly or immutable field context",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L10591",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Maintained heterogeneous TypedDict pair widening regression",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md#L187",
              "blob": "bb437c45046408d685777e1ab3ad604f09457295"
            },
            {
              "label": "Ordered per-relation pending contributions and source-group validation",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L7858",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Call-owned last complete projection; selection and validation remain outside",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L9606",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            },
            {
              "label": "Scoped immediate constraint identities retained in cache equality",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/constraints.rs#L1723",
              "blob": "88576e91defcda500d7cf02525314f321fa8d438"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Merged empty collection peer inference #29131",
          "url": "https://github.com/astral-sh/ruff/pull/29131"
        }
      ]
    },
    {
      "id": "investigation:ty-editor-api",
      "title": "Reusable editor queries",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Expose reusable editor queries while keeping host resolution and presentation policy outside Python semantics.",
      "nextStep": "Compare surviving source with current upstream, classify host-only policy separately, and reproduce each general improvement before preparing a qualified proposal.",
      "findings": [
        {
          "text": "Share active signature parameter selection — crates/ty_ide/src/signature_help.rs, crates/ty_python_semantic/src/types/ide_support.rs",
          "evidence": [
            {
              "label": "7ff920b199c5094e91de972c472abc8aee60f796",
              "url": "https://github.com/tamird/ruff/commit/7ff920b199c5094e91de972c472abc8aee60f796"
            }
          ]
        },
        {
          "text": "Share semantic token classification — crates/ty_ide/src/lib.rs, crates/ty_ide/src/semantic_tokens.rs",
          "evidence": [
            {
              "label": "71f92d63100ccd58bb9441ca4ec9c9bc3e88674a",
              "url": "https://github.com/tamird/ruff/commit/71f92d63100ccd58bb9441ca4ec9c9bc3e88674a"
            }
          ]
        },
        {
          "text": "Expose file-local semantic references — crates/ty_ide/src/lib.rs, crates/ty_ide/src/references.rs",
          "evidence": [
            {
              "label": "bc6cd6ade301e7880ed630a6ddb906c1a68849a6",
              "url": "https://github.com/tamird/ruff/commit/bc6cd6ade301e7880ed630a6ddb906c1a68849a6"
            }
          ]
        },
        {
          "text": "Separate inlay hints from Python edits — crates/ty_ide/src/inlay_hints.rs, crates/ty_ide/src/lib.rs",
          "evidence": [
            {
              "label": "e21beab86ff5bfb3071cf81fb35abcecf6ac8356",
              "url": "https://github.com/tamird/ruff/commit/e21beab86ff5bfb3071cf81fb35abcecf6ac8356"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-diagnostic-policy",
      "title": "Host diagnostic and suppression policy",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Separate host diagnostic selection and suppression policy from shared diagnostic production.",
      "nextStep": "Compare surviving source with current upstream, classify host-only policy separately, and reproduce each general improvement before preparing a qualified proposal.",
      "findings": [
        {
          "text": "Allow embedders to require valid suppressions — crates/ty/docs/rules.md, crates/ty_python_semantic/resources/lint_docs/blanket-ignore-comment.md, crates/ty_python_semantic/src/lint.rs, crates/ty_python_semantic/src/suppression.rs, crates/ty_python_semantic/src/suppression/unused.rs, ty.schema.json",
          "evidence": [
            {
              "label": "fc3b29f0adb11528151e387373eea142481a5218",
              "url": "https://github.com/tamird/ruff/commit/fc3b29f0adb11528151e387373eea142481a5218"
            }
          ]
        },
        {
          "text": "[ty] Require scoped suppressions for embedders — crates/ty/docs/rules.md, crates/ty_python_semantic/resources/lint_docs/blanket-ignore-comment.md, crates/ty_python_semantic/src/lint.rs, crates/ty_python_semantic/src/suppression.rs, ty.schema.json",
          "evidence": [
            {
              "label": "5ee6d94cf53e4746684f7048666274b6060afbaf",
              "url": "https://github.com/tamird/ruff/commit/5ee6d94cf53e4746684f7048666274b6060afbaf"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-host-runtime",
      "title": "Host iterator, string and Boolean semantics",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Reconcile host runtime differences with Python defaults and keep Starlark behavior explicit.",
      "nextStep": "Compare surviving source with current upstream, classify host-only policy separately, and reproduce each general improvement before preparing a qualified proposal.",
      "findings": [
        {
          "text": "Respect declared string iteration contracts — Cargo.lock, crates/ty_python_semantic/Cargo.toml, crates/ty_python_semantic/src/db.rs, crates/ty_python_semantic/src/types/iteration.rs, crates/ty_python_semantic/src/types/relation.rs, crates/ty_python_semantic/src/types/tests.rs",
          "evidence": [
            {
              "label": "5dc76a7745ed08465ec32f3003a9bce384822a81",
              "url": "https://github.com/tamird/ruff/commit/5dc76a7745ed08465ec32f3003a9bce384822a81"
            }
          ]
        },
        {
          "text": "Gate Boolean numeric literal optimizations — crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/class/known.rs, crates/ty_python_semantic/src/types/enums.rs, crates/ty_python_semantic/src/types/equality.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs, crates/ty_python_semantic/src/types/infer/builder/enum_call.rs, crates/ty_python_semantic/src/types/infer/comparisons.rs, crates/ty_python_semantic/src/types/instance.rs, crates/ty_python_semantic/src/types/narrow.rs, crates/ty_python_semantic/src/types/subscript.rs, crates/ty_python_semantic/src/types/tests.rs",
          "evidence": [
            {
              "label": "d5b2f3db259cd1d0b6e3f8200f48b70be61911bd",
              "url": "https://github.com/tamird/ruff/commit/d5b2f3db259cd1d0b6e3f8200f48b70be61911bd"
            }
          ]
        },
        {
          "text": "Support embedded string literal interpretation — crates/ruff_db/src/lib.rs, crates/ruff_db/src/parsed.rs, crates/ruff_python_parser/src/lib.rs, crates/ruff_python_parser/src/parser/expression.rs, crates/ruff_python_parser/src/parser/mod.rs, crates/ruff_python_parser/src/parser/options.rs, crates/ruff_python_parser/src/string.rs, crates/ty_python_semantic/src/semantic_model.rs, crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs, crates/ty_python_semantic/src/types/infer/implicit_alias.rs, crates/ty_python_semantic/src/types/string_annotation.rs",
          "evidence": [
            {
              "label": "6ad38a59c6268796d1ed49af724cbc05a101836a",
              "url": "https://github.com/tamird/ruff/commit/6ad38a59c6268796d1ed49af724cbc05a101836a"
            }
          ]
        },
        {
          "text": "Apply the host string sequence policy during literal relations. String literal relations first test whether the configured str class has its character Sequence base; unsupported direct sequence fast paths delegate to actual fallback-instance relation rather than unconditionally rejecting. Next: Keep Python default behavior and separately test hosts excluding str from Sequence[str].",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L3145"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-structural-relations",
      "title": "TypedDict and protocol relations",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Check surviving structural relation changes against current TypedDict and protocol behavior.",
      "nextStep": "Compare surviving source with current upstream, classify host-only policy separately, and reproduce each general improvement before preparing a qualified proposal.",
      "findings": [
        {
          "text": "Infer closed TypedDict values in protocols — crates/ty_python_semantic/resources/mdtest/typed_dict.md, crates/ty_python_semantic/src/types/class/typed_dict.rs",
          "evidence": [
            {
              "label": "cb54d4b8e0ea88ff5bff0b2b4245ee1c59ba19f9",
              "url": "https://github.com/tamird/ruff/commit/cb54d4b8e0ea88ff5bff0b2b4245ee1c59ba19f9"
            }
          ]
        },
        {
          "text": "[ty] Check TypedDict unions with literals — crates/ty_python_semantic/resources/mdtest/typed_dict.md, crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs, crates/ty_python_semantic/src/types/infer/builder/typed_dict.rs",
          "evidence": [
            {
              "label": "c18d08bf614fac225a18aad33f7e638e2180c1cb",
              "url": "https://github.com/tamird/ruff/commit/c18d08bf614fac225a18aad33f7e638e2180c1cb"
            }
          ]
        },
        {
          "text": "[ty] Reuse compatible TypedDict union results — crates/ty_python_semantic/resources/mdtest/typed_dict.md, crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs",
          "evidence": [
            {
              "label": "8478653dc0f30541ee1790b113c2d18d79b31510",
              "url": "https://github.com/tamird/ruff/commit/8478653dc0f30541ee1790b113c2d18d79b31510"
            }
          ]
        },
        {
          "text": "Preserve bounded TypedDict values in dictionary merges — crates/ty_python_semantic/resources/mdtest/typed_dict.md, crates/ty_python_semantic/src/types/class/typed_dict.rs",
          "evidence": [
            {
              "label": "14518b0b59f746166f55a8f86fb4610f315c8e83",
              "url": "https://github.com/tamird/ruff/commit/14518b0b59f746166f55a8f86fb4610f315c8e83"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-contextual-callbacks",
      "title": "Contextual lambda and callback inference",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Reconcile expected-type inference for lambdas and callbacks with current upstream inference.",
      "nextStep": "Compare surviving source with current upstream, classify host-only policy separately, and reproduce each general improvement before preparing a qualified proposal.",
      "findings": [
        {
          "text": "[ty] Infer lambda positional captures — crates/ty_python_semantic/resources/mdtest/bidirectional.md, crates/ty_python_semantic/resources/mdtest/expression/lambda.md, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/function.rs, crates/ty_python_semantic/src/types/signatures.rs",
          "evidence": [
            {
              "label": "8532eec7571c63559c6401858047cef4ffb808db",
              "url": "https://github.com/tamird/ruff/commit/8532eec7571c63559c6401858047cef4ffb808db"
            }
          ]
        },
        {
          "text": "[ty] Preserve contextual lambda tuple shapes — crates/ty_python_semantic/resources/mdtest/cycle/implicit_instance_attributes.md, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/provided/tests.rs",
          "evidence": [
            {
              "label": "c521d505b8e1000e218ceafe9eb1e45622f7f439",
              "url": "https://github.com/tamird/ruff/commit/c521d505b8e1000e218ceafe9eb1e45622f7f439"
            }
          ]
        },
        {
          "text": "Infer lambda defaults with parameter context — crates/ty_python_semantic/resources/mdtest/expression/lambda.md, crates/ty_python_semantic/src/types/infer/builder.rs",
          "evidence": [
            {
              "label": "0b5c59dbadbfde1b836cdf4f7c1e82056b4783b2",
              "url": "https://github.com/tamird/ruff/commit/0b5c59dbadbfde1b836cdf4f7c1e82056b4783b2"
            }
          ]
        },
        {
          "text": "Infer lambda inputs from callback protocols — crates/ty_python_semantic/resources/mdtest/cycle/basic.md, crates/ty_python_semantic/resources/mdtest/expression/lambda.md, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/infer/builder/function.rs",
          "evidence": [
            {
              "label": "815d619e2dea9becd7d42c588653118c97971b99",
              "url": "https://github.com/tamird/ruff/commit/815d619e2dea9becd7d42c588653118c97971b99"
            }
          ]
        },
        {
          "text": "Request final argument context for unspecialized nominal union arms. Top-level aliases/unions are inspected for nominal instances containing UnspecializedTypeVar; gradual Any/Unknown and callable alternatives preserve their distinct contextual behavior. Next: Reconcile single-collection contextual replay with existing #27665 and native nominal_union_arguments_need_final_context fixture.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L750"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retry argument solving after rejected expected-result preferences. Provisional expected context contributes concrete remainder covariantly, permitting unresolved parts to widen. On failure, clear preferred mappings, rebuild argument constraints with empty preferences and reset errors, then solve again; resulting type may still fail outer assignment. Next: Separate native invariant input/result preference regression from host callback policy.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L7845"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Separate argument context caches by evidence source and inference phase. Cache has all-evidence/without-prior-arguments crossed with provisional/final slots. WithoutArguments excludes this call prior specialization but does not claim independence from enclosing inference queries. Final mode replaces unspecialized/provisional values with upper bound or Unknown and skips provisional selected bindings. Next: Qualify finite caller admission and expected-result fallback separately.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L676"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Visit stored alias arguments without forcing alias bodies. Inferable occurrence collection traverses explicit TypeAlias/Recursive argument specializations even when lazy definitions are not visited, preventing skipped contextual replay. Next: Reduce generic alias argument-only occurrence and ensure no unrelated lazy body evaluation.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L9672"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Let sibling evidence refine locally inferable bounded variables. Use upper-bound context immediately only for Self, caller-fixed variables or WithoutArguments source. Locally inferable ordinary bounded variables use provisional specialization so sibling arguments can provide narrower empty-container context first. Next: Coordinate existing proposal and native empty bounded collection cases.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L10283"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Normalize parameter and return types only within compatible signature contexts. Cycle normalization keeps generic context/definition/extras together. Initial placeholder permits first real layout; resolved Unpack TypedDict rows can replace unresolved final kwargs in either direction. Incompatible layouts widen entire signature to no-call/top-return after taint; previously widened top absorbs later changes. Positional-only/variadic names retain previous presentation after taint. Next: Compare upstream #29553 and verify that open keyword rows cannot grow without bound.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L204"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Give lambda fixed inputs and args one consistent positional context. Normalize starred annotations then partition fixed prefix/captured positional segment/keyword tail. Direct homogeneous vararg can pass through. Synthesized starred tuple context requires nondefault positional-only slots, at most one ordinary variadic and complete suffix coverage; keyword-routable/optional ambiguous shapes decline. Next: Coordinate existing finite lambda proposal and compare full variadic contextual fixture cases.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7035"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Commit shared overload argument context once. General Python contextual inference candidate; known overlap gates remain open. Next: Compare complete diffs of upstream PR27665 and29553, then retain raw-key/ParamSpec-key, reverse-order, differing/absent-context and exactly-once diagnostic controls.",
          "evidence": [
            {
              "label": "Shared overload contexts agree on primary and fallback",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/infer/builder.rs#L7151",
              "blob": "c113fadc12f327faf94a2bf522bb476c8f374353"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-return-inference",
      "title": "Source function return inference",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Requires current-upstream reconciliation. Determine which source return-inference refinements remain necessary on current upstream.",
      "nextStep": "Compare surviving source with current upstream, classify host-only policy separately, and reproduce each general improvement before preparing a qualified proposal.",
      "findings": [
        {
          "text": "[ty] Infer unannotated function call results — crates/ty_python_semantic/resources/mdtest/decorators.md, crates/ty_python_semantic/resources/mdtest/function/return_type_inference.md, crates/ty_python_semantic/src/db.rs, crates/ty_python_semantic/src/lib.rs, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/function.rs, crates/ty_python_semantic/src/types/infer.rs, crates/ty_python_semantic/src/types/infer/builder.rs, crates/ty_python_semantic/src/types/method.rs, crates/ty_python_semantic/src/types/provided/tests.rs",
          "evidence": [
            {
              "label": "68824c5e9831b7064734ec042d0c0739c209ebe2",
              "url": "https://github.com/tamird/ruff/commit/68824c5e9831b7064734ec042d0c0739c209ebe2"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-loop-initial-binding",
      "title": "Relate initial bindings across coordinated loop updates",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Old-fork candidate; current-upstream reproduction pending. certifies_predicate and initial_binding_implies_empty preserve an initial binding when a proven untouched empty list and coordinated assignments rule it out after a loop. This is a bounded tracked proof, not general loop invariant inference.",
      "nextStep": "Reproduce the coordinated-update example on current ty; retain partial-write, allocation-mutation, cycle/query-order and incremental edit negatives from loop_bindings.rs. Compare current loop reachability ownership before porting.",
      "findings": [
        {
          "text": "Relate initial bindings across simple for loops — crates/ty_python_core/src/builder.rs, crates/ty_python_core/src/definition.rs, crates/ty_python_core/src/lib.rs, crates/ty_python_core/src/reachability_constraints.rs, crates/ty_python_semantic/resources/mdtest/loops/for.md, crates/ty_python_semantic/src/place.rs, crates/ty_python_semantic/src/reachability.rs, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/loop_bindings.rs",
          "evidence": [
            {
              "label": "1f5b037531454583e815927916829ac08063bb62",
              "url": "https://github.com/tamird/ruff/commit/1f5b037531454583e815927916829ac08063bb62"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-attribute-presence",
      "title": "Required intersection members during attribute assignment",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Old-fork candidate; current-upstream reproduction pending. AttributeWriteRequirement::is_definitely_bound lets a required intersection component establish member presence without treating dynamic getters or Any bases as declared storage. AssignmentAttributeWriteEvaluator preserves Final and union diagnostics.",
      "nextStep": "Review the qualified presence fix. The existing intersection-write test caught the false warning and required only removing its obsolete TODO and error expectation.",
      "findings": [
        {
          "text": "[ty] Fix missing-attribute intersection warnings — crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md, crates/ty_python_semantic/src/types/attribute_write.rs, crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs",
          "evidence": [
            {
              "label": "fa52c04a810e25fbf4265750f576210797ad94fe",
              "url": "https://github.com/tamird/ruff/commit/fa52c04a810e25fbf4265750f576210797ad94fe"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-bound-receiver",
      "title": "Preserve the instance while checking specialized method receivers",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Old-fork candidate; current-upstream reproduction pending. SplitBoundMethodReceiver separates the actual instance used for __self__/typing.Self from the signature receiver used to check an alternative of a bounded union. Its call/methods and legacy generic fixtures are old-fork evidence.",
      "nextStep": "Reproduce bound-union receiver, Self and subscript/typevar examples on current ty. Qualify method binding and generic suites and inspect current descriptor/member policy before extracting a proposal.",
      "findings": [
        {
          "text": "[ty] Bind members through union upper bounds — crates/ty_python_semantic/resources/mdtest/call/methods.md, crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md, crates/ty_python_semantic/resources/mdtest/regression/noninferable_projection_to_terminal.md, crates/ty_python_semantic/resources/mdtest/subscript/typevar.md, crates/ty_python_semantic/src/types.rs, crates/ty_python_semantic/src/types/infer/comparisons.rs, crates/ty_python_semantic/src/types/method.rs",
          "evidence": [
            {
              "label": "327e0042634dcbd7d1db5793b7bb0bd0d29d48a8",
              "url": "https://github.com/tamird/ruff/commit/327e0042634dcbd7d1db5793b7bb0bd0d29d48a8"
            }
          ]
        },
        {
          "text": "Evaluate receiver obligations within active signature relations. Recursive relation correction dependent on existing receiver contract representation. Next: Retain recursive factory, shared-witness, strict gradual and nested immutable/mutable storage controls. Keep the previously qualified Sty membership cases in the current-head gate. Isolate the general receiver correction and its provided-instance dependency against upstream before requesting Tamir review.",
          "evidence": [
            {
              "label": "signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/signatures.rs#L868",
              "blob": "5d19725f68178456e30b4637a117f00c5238de79"
            },
            {
              "label": "Nested provided storage regression",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/provided/tests.rs#L557",
              "blob": "92d24415701b0c5d89140ad2a4d4864b570c4440"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-recursive-protocol-materialization",
      "title": "Subtract landed recursive-protocol materialization work",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Old-fork candidate; current-upstream reproduction pending. Upstream 19cb997763936be5bd7f3f791965366a99b3989b carries the same #29026 change title. The fork also contains later protocol and constraint changes: this lineage is not proof that the complete instance/protocol/visitor delta is equivalent.",
      "nextStep": "Compare the #29026 patches and subtract their equivalent behavior; benchmark any residual recursive specialization changes using the added recursive protocol microbenchmarks and incremental member-edit test.",
      "findings": [
        {
          "text": "[ty] Avoid expanding recursive protocol materializations (#29026) — crates/ruff_benchmark/benches/ty.rs, crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md, crates/ty_python_semantic/resources/mdtest/generics/pep695/classes.md, crates/ty_python_semantic/resources/mdtest/protocols.md, crates/ty_python_semantic/resources/mdtest/type_properties/materialization.md, crates/ty_python_semantic/resources/mdtest/with/async.md, crates/ty_python_semantic/src/types/generics.rs, crates/ty_python_semantic/src/types/infer/tests.rs, crates/ty_python_semantic/src/types/instance.rs, crates/ty_python_semantic/src/types/protocol_class.rs, crates/ty_python_semantic/src/types/visitor.rs",
          "evidence": [
            {
              "label": "cfe08719485af4506aae4ca1462a1dd13042e09e",
              "url": "https://github.com/tamird/ruff/commit/cfe08719485af4506aae4ca1462a1dd13042e09e"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Upstream #29026 commit",
          "url": "https://github.com/astral-sh/ruff/commit/19cb997763936be5bd7f3f791965366a99b3989b"
        }
      ]
    },
    {
      "id": "investigation:ty-vendored-root",
      "title": "List entries at a vendored archive root",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Old-fork candidate; current-upstream reproduction pending. VendoredFileSystem::read_directory treats normalized empty paths as the archive root instead of prefixing a slash. read_directory_root checks empty, dot, slash and normalized-parent spellings.",
      "nextStep": "Review the qualified root-listing fix and coordinate the overlap with the draft archive rewrite #29829.",
      "findings": [
        {
          "text": "List root entries in vendored archives — crates/ruff_db/src/vendored.rs",
          "evidence": [
            {
              "label": "17ee6afa71944cbc0f46d652e7e3a78940f9f873",
              "url": "https://github.com/tamird/ruff/commit/17ee6afa71944cbc0f46d652e7e3a78940f9f873"
            }
          ]
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-guard-call-mapping",
      "title": "Keep TypeIs and TypeGuard targets through argument expansion",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Old-fork candidate; current-upstream reproduction pending. TypeGuardArgument distinguishes a mapped call argument, an omitted target and unavailable mapping. bind_type_guard_return_type uses parameter provenance rather than guessing another argument after expansion. Later ambiguous-call changes share this boundary.",
      "nextStep": "Reproduce starred/keyword expansion, omitted targets, bound receivers and overload disagreement on current ty; retain identity-function forwarding and provisional inference negatives before extracting any still-needed change.",
      "findings": [
        {
          "text": "[ty] Track guard targets across call expansions — crates/ty_python_semantic/resources/mdtest/narrow/type_guards.md, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/infer/builder/typeguard.rs",
          "evidence": [
            {
              "label": "babd7e2affadeb88fd328fd516d43a5e5f232f4c",
              "url": "https://github.com/tamird/ruff/commit/babd7e2affadeb88fd328fd516d43a5e5f232f4c"
            }
          ]
        },
        {
          "text": "Match predicate target arguments using actual selected overload bindings. Record Unmapped, NoTarget and exact source argument index. Include implicit receiver offsets, omission/disagreement and all argument-expansion cases. A target parameter omitted or mapped differently cannot use a default source argument fallback. Next: Extract native keyword/receiver/overload/omitted-target cases.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L3792"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain TypeIs only if every surviving declaration proves the same predicate. Require one unbound complete non-bottom TypeIs return and a common mapped target. Every TypeIs arm must agree; constant Boolean arms must strictly exclude the opposite target outcome over their top-materialized parameter domain. Next: Reduce mixed Literal[True/False]/TypeIs overload examples.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L5231"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Bound proof of constant TypeIs overload arms. Existing predicate-certification family stabilization. Next: Extract with certified predicate preservation and fail-closed complement distribution/resource controls; inspect upstream predicate overlap before proposing a separate change.",
          "evidence": [
            {
              "label": "call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/07a4f30c36d8f27455d2785f9abef566e0bf3641/crates/ty_python_semantic/src/types/call/bind.rs#L5453",
              "blob": "1b0083a9fd4a82650ffd2390cd0ebc6c2478ed4b"
            }
          ],
          "sourceInventory": true,
          "forwardSourceInventory": true
        }
      ],
      "evidence": []
    },
    {
      "id": "investigation:ty-generic-method-target-variables",
      "title": "Reject incompatible payloads behind generic methods",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Upstream reproduced; fix not qualified. Structural comparison accepts Result[str] as Result[int] when a generic first_or method returns its payload or a caller-supplied fallback. The same false acceptance occurs with nested recursive payloads. Direct recursive payload comparison rejects correctly. Baseline and deferred-receiver experiments agree in both generic syntaxes, so this is a separate signature-comparison defect.",
      "nextStep": "Reconcile existing upstream reports #2924 and #2323, binder PR #29027 and the closed higher-rank attempt #26638 before preparing feedback or extracting another binder implementation. Keep the scoped-binder prerequisite under ty-scoped-witness-proofs. Resolve capture avoidance, bounded mapping and complete versus incomplete witness families at the actual decision boundary. Then qualify caller variables, constrained domains and recursive comparisons before requesting Tamir review.",
      "findings": [],
      "evidence": [
        {
          "label": "Existing upstream existential-binder proposal",
          "url": "https://github.com/astral-sh/ruff/pull/29027"
        },
        {
          "label": "Earlier higher-rank comparison attempt, closed unmerged",
          "url": "https://github.com/astral-sh/ruff/pull/26638"
        },
        {
          "label": "Related upstream report: generic callable implementations",
          "url": "https://github.com/astral-sh/ty/issues/2924"
        },
        {
          "label": "Related maintainer discussion: generic protocol soundness",
          "url": "https://github.com/astral-sh/ty/issues/2323"
        },
        {
          "label": "Pristine upstream aee01ae4: all four strict regressions fail",
          "url": "https://app.buildbuddy.io/invocation/c9bd6662-24de-4657-a240-8790f755e77b"
        },
        {
          "label": "Baseline and receiver candidate: all 12 causal comparisons",
          "url": "https://app.buildbuddy.io/invocation/66c01da1-5560-4a0c-8a22-54ed5b51477e"
        },
        {
          "label": "Published generic Result and recursive factory definitions",
          "url": "https://github.com/tamird/ruff/blob/f9d7ec289b4b428a8994181d3c117477a8709f03/crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md#L6310"
        }
      ]
    },
    {
      "id": "investigation:ty-fork-reconciliation",
      "title": "Reconcile the entire pinned Ruff fork",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Reconciliation in progress. Qualified Sty 14d05b98 pins Ruff 07a4f30c on official 75fabee2. Eight native targets, the optimized build and all 148 unchanged corpus cases pass. All 20 community checks execute with unchanged outcomes: 11 strict passes, six advisory completions and three known failures. All eight qualified workflow refreshes are published. Full Ruff Markdown retains 507 passing and 31 unchanged failing fixtures. Ruff’s maintained build branch now pins Bazel rustfmt to Rust 1.100.0 in 928316fb; Cargo inputs and Rust sources are unchanged.",
      "nextStep": "Follow current-head CI and maintainer feedback on submitted PRs #30761, #30848, #30897 and #30898, then reconcile their outcomes with the fork. Continue the existing Apple/LLVM contract work and smaller-contribution redesign of the withdrawn fresh-collection proposal.",
      "findings": [
        {
          "text": "[ty] Accept immediately guarded dictionary reads — crates/ty_python_semantic/resources/mdtest/narrow/conditionals/in.md, crates/ty_python_semantic/src/types/dictionary.rs, crates/ty_python_semantic/src/types/infer/builder/subscript.rs, crates/ty_python_semantic/src/types/subscript.rs",
          "evidence": [
            {
              "label": "352ce32f76a8416551cb72d66dfa4f6d75a7c7e9",
              "url": "https://github.com/tamird/ruff/commit/352ce32f76a8416551cb72d66dfa4f6d75a7c7e9"
            }
          ]
        }
      ],
      "evidence": [
        {
          "label": "Qualified Sty engine and Ruff pin",
          "url": "https://github.com/tamird/sty/commit/14d05b98238e2c0bf7773c81bbeb209861a7145b"
        },
        {
          "label": "Eight native targets and optimized build on RBE",
          "url": "https://app.buildbuddy.io/invocation/d3a78c0a-0ae7-45be-bc93-d6c0eac85c25"
        },
        {
          "label": "Ruff native and full Markdown: 538 fixtures; 31 known failures",
          "url": "https://app.buildbuddy.io/invocation/43ad4d02-b014-4606-b1e5-35fdc81f700a"
        },
        {
          "label": "Current source audit and separate runtime observations",
          "url": "https://tamird.github.io/sty/ruff-forward-audit.json"
        },
        {
          "label": "All eight LLVM checks execute; two strict failures remain",
          "url": "https://app.buildbuddy.io/invocation/dd978d27-6ff9-436d-8925-6e9e5afc8737"
        },
        {
          "label": "Bazel rustfmt pinned to Rust 1.100.0",
          "url": "https://github.com/tamird/ruff/commit/928316fb0471779f50fb65f7041c6642bd241ff1"
        },
        {
          "label": "Pinned formatter, ty_format and changed-config hooks on RBE",
          "url": "https://app.buildbuddy.io/invocation/b88fbd58-7aa0-4903-bc8f-03a009f57cce"
        },
        {
          "label": "Frozen source receipt and historical coverage",
          "url": "https://tamird.github.io/sty/ruff-fork-audit.json"
        }
      ]
    },
    {
      "id": "investigation:ty-typevar-domain-identity",
      "title": "Keep specialized TypeVar domains distinct",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Track specialized bounds in TypeVar identity while preserving materialized views and exact ParamSpec components.",
      "nextStep": "Reduce domain identity and substitution cases; qualify captured binders and compare upstream #29555.",
      "findings": [
        {
          "text": "Keep specialized TypeVar domains distinct — crates/ty_python_semantic/src/types/constraints.rs, crates/ty_python_semantic/src/types/constraints/solutions.rs, crates/ty_python_semantic/src/types/generics.rs, crates/ty_python_semantic/src/types/typevar.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Include specialized canonical domains in bound TypeVar identity. Retain an original declaration and derive canonical identity from its specialized domain, separately from materialized/transposed visible views. No-op/restored mappings preserve identity; staged and direct substitutions agree. Synthetic Self records its original domain to distinguish binders. Next: Extract domain-identity invariants together with retained-domain mapping. Native tests exist.",
          "evidence": [
            {
              "label": "types/typevar.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1068"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Freshen exact projection scopes without capturing sibling components. Freshening admits either an exact component scope or its base-family scope, updates the specialized domain after freshening, and preserves original/canonical identity when materializing. Next: Include base/args/kwargs/keyword projection independence and captured lazy-domain tests.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L586"
            },
            {
              "label": "types/typevar.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1672"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Specialize retained TypeVar domains by default. Specialization composition maps retained domains by default. PreserveTypeVarDomains is an explicit opt-out; Partial and Single retain their bounded/dependency-resolution roles. WithBoundVariables forward deltas shadow substitutions inside retained callable binders. Next: Review domain identity and capture-avoiding substitution together, including retained callable binders.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L1440"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Group simple conjunction bounds by canonical stored TypeVar IDs. Fast-path bound maps key by storage TypeVarId rather than possibly distinct bound-view instances, then recover canonical stored data when solving. Next: Test materialized/transposed views of same identity share one bound solver while distinct specialized domains remain distinct.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4546"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Group candidate bounds by stored logical TypeVar identity. Pending maps use TypeVarId so materialized views of one logical variable share bounds and validity constraints. Solver resolves canonical stored bound data before finishing. Next: Extract with materialized/transposed view identity and distinct specialized domain tests.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L2519"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/typevar.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1068"
        },
        {
          "label": "types/generics.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L586"
        },
        {
          "label": "types/typevar.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1672"
        }
      ]
    },
    {
      "id": "investigation:ty-scoped-witness-proofs",
      "title": "Preserve scoped generic witnesses through inference",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python solver design. Keep local binders, declared domains and correlated witnesses together through inference, replay and bounded proof. Unknown proofs remain incomplete.",
      "nextStep": "Compare upstream PR #29027 before extracting the binder representation. Reduce the remaining quantified-domain, witness-correlation and budget differences for design review.",
      "findings": [
        {
          "text": "Preserve scoped generic witnesses through inference — crates/ty_python_semantic/src/types/call/arguments.rs, crates/ty_python_semantic/src/types/constraints.rs, crates/ty_python_semantic/src/types/constraints/owned.rs, crates/ty_python_semantic/src/types/constraints/paths.rs, crates/ty_python_semantic/src/types/constraints/projection.rs, crates/ty_python_semantic/src/types/constraints/resolution.rs, crates/ty_python_semantic/src/types/constraints/sequents.rs, crates/ty_python_semantic/src/types/constraints/solutions.rs, crates/ty_python_semantic/src/types/constraints/support.rs, crates/ty_python_semantic/src/types/constraints/variables.rs, crates/ty_python_semantic/src/types/cyclic.rs, crates/ty_python_semantic/src/types/generics.rs, crates/ty_python_semantic/src/types/relation.rs, crates/ty_python_semantic/src/types/typevar.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Retain quantified local binders in the constraint graph. An existential constraint stores local support, provenance, body and source ordering. Mapping substitutes the body and remaining local TypeVars, then re-quantifies; vacuous quantification is removed when body support has no overlap. Atomic type enumeration intentionally excludes quantified bodies. Next: Compare PR #29027 before extracting; preserve quantified/free-variable counterexamples and owned round trips.",
          "evidence": [
            {
              "label": "types/constraints/variables.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L123"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Inspect mapped atomic roots without loading an entire relation. MappedAtomicConstraint represents mapped lower/upper/equivalence bounds or a borrowed/owned relation. Root-only truth queries inspect cached relation roots without graph traversal; ordinary mapping subsequently loads the atom. Mapping concrete bounds to non-TypeVars produces ordinary assignability relations. Next: Reduce mapped-root proof support against the rebased upstream relation API.",
          "evidence": [
            {
              "label": "types/constraints/variables.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L222"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Exclude unspecialized context slots from solver evidence. Lower, upper and equivalence constraints reject UnspecializedTypeVar; generic mapping and inference also skip that exact placeholder. This preserves missing evidence rather than defaulting it into a fixed point. Next: Reduce native recursive/contextual-call examples and compare #29553 deferred lambda inputs before proposing a general fix.",
          "evidence": [
            {
              "label": "types/constraints/variables.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L301"
            },
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L4050"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Permit repeated relation keys only when context makes bounded progress. ActiveRecursionDetector stores the nearest active context per key. A caller-supplied well-founded progress test may permit re-entry. The entry borrow is released before evaluating progress; unwind restores the previous context rather than deleting an enclosing visit. Next: Review each progress relation for termination and retain re-entrant/unwind regression.",
          "evidence": [
            {
              "label": "types/cyclic.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/cyclic.rs#L1224"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Distinguish finite gradual types from unresolved inference. has_indeterminate_inference delegates to the alias-aware visitor: contextual/divergent placeholders and expanding alias states prevent finite proof; stable Any/Unknown remain admissible. Next: Use finite/recursive alias regressions and no body-forcing benchmark before upstream design review.",
          "evidence": [
            {
              "label": "types/typevar.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L153"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose nonce increment and remove unused specialization import. Visibility/import adjustments support freshening and domain ownership; they do not independently fix behavior. Next: Carry with owning change.",
          "evidence": [
            {
              "label": "types/typevar.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L20"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Sequence source and target argument materialization explicitly. Refactor check_specialization_pair into separate source/target materialization bindings before check_type_pair; evaluation order is explicit with no new predicate. Next: Carry only if needed by owner borrow/context refactor.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L1860"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Defer only return variables whose arguments are unresolved. A bare divergent actual for a structured formal supplies no argument evidence. If an uninferred ordinary TypeVar occurs in both formal and return, preserve one shared divergent marker. Different markers, materialized fallback, bare-TypeVar formal and independent return variables do not trigger deferral. Next: Compare #29553 finite-lambda foundation, then isolate a native recursive ordinary-call reproducer without host hooks.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L2681"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Resolve dependencies after selecting merged solver evidence. Projection hook distinguishes inferred, override and retained generic variables. Chosen/default types resolve jointly, retaining explicit generic binders and recovering unresolved dependency cycles to unknown. Partial projection substitutes UnspecializedTypeVar for missing/provisional evidence. Original correlated alternatives are unchanged. Next: Extract selected-dependency and retained-binder proof with cycle/outer-scope tests.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L2659"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Share proof resources across native solving and signature completion. One ProjectionBudget is passed into native solution collection and all keyword-completion witnesses. Exhaustion does not restart searches; verified siblings survive as incomplete alternatives. Next: Include calibrated two-witness exhaustion regression.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L3217"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Verify whole ParamSpec signatures inferred from keyword-only evidence. A keyword surface cannot determine positional behavior. Build complete candidate witnesses, verify them against the original joint relation and retain T/P path correlations. Charge TypedDict items. Top/no-call signature is a fallback candidate requiring verification. Unverified families widen merged mappings, rather than narrowing to visited witnesses. Next: Review extension semantics separately from proof infrastructure.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L2885"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Remove solver artifacts before dependency closure. Clean inferable-variable artifacts from projected candidate solutions before dependency resolution so transitive terms cannot manufacture cycles. Next: Reduce with native inference_cleans_merged_types and expanding-cycle cases.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L3052"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Collapse complete equivalent solver alternatives. When every complete nonempty alternative equals the merged mapping, expose Single rather than retaining a redundant alternative family. Incomplete/empty families cannot use this shortcut. Next: Retain native equal-fallback/complete-sibling tests and confirm no loss of caller-visible correlation.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L3684"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Infer structural constraints from fixed bounded TypeVars. For covariant protocol/union formal compared with non-inferable bounded actual TypeVar, use a relation constraint when admissible; unions involving inferable packs retain legacy handling. Next: Produce ordinary Python protocol/bounded-TypeVar regression and confirm free-domain policy.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L4848"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain correlated alternatives when inferring nominal and generic unions. Use a single constraint relation for multiple generic union elements and nominal actual unions so later arguments/discriminators constrain one solution. Preserve gradual, Self and pack rules; divergent unmaterialized arms may participate without discarding concrete peers. Next: Check #27665 contextual collection overlap and upstream #30483 relation composition before proposing reduced ordinary Python cases.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L4774"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Ignore redundant nominal FunctionType evidence beside callable signatures. When a callable intersection contains an explicit signature component, skip the nominal FunctionType component whose __call__ is only generic function binding evidence. Next: Coordinate #29555 generic FunctionType producer.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L5251"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Collect structural constraints from synthesized protocols. Protocols without a nominal class origin contribute member constraints even in covariant positions; named protocols preserve the prior variance rule. Next: Use ordinary synthesized-callback/protocol regression and inspect #29555 callable owner interactions.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L5428"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Route provided instances and dictionary schemas through relation inference. Provided nominal instances use relation solving; nominal-formal/TypedDict-actual is explicitly admitted, and TypedDict formal dispatch moves before a broad legacy branch. Next: Split host nominal admission from ordinary TypedDict dispatch regression when reducing contributions.",
          "evidence": [
            {
              "label": "types/generics.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/generics.rs#L5578"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Import shared observation and quantified proof support. Imports only; behavioral ownership belongs to separately identified units. Next: Carry only with owning mechanism.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L2"
            },
            {
              "label": "types/constraints/owned.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/owned.rs#L4"
            },
            {
              "label": "types/constraints/resolution.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/resolution.rs#L5"
            },
            {
              "label": "types/constraints/support.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/support.rs#L8"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve quantified bodies and scoped evidence ordering in owned graphs. Owned graph compaction traverses existential bodies, remaps nested source orders, and visits constraints once per source-order scope rather than globally. Ordering-only constraints sharing live variables remain present. Iterative traversal avoids recursive order-tree growth. Next: Require quantified owned round trips and shared-body ordering tests before extraction.",
          "evidence": [
            {
              "label": "types/constraints/owned.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/owned.rs#L20"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Snapshot one reachable proof graph without builder memo tables. A shared-storage snapshot marks reachable nodes/support/constraints, reads compacted overlays and retains the original complete TypeVar ID table. Shared finish_parts trims rank maps and remaps existential source-order IDs. Next: Extract snapshot and quantifier support against the upstream cache API.",
          "evidence": [
            {
              "label": "types/constraints/owned.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/owned.rs#L44"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Close anchored positive-union dependency cycles symmetrically. Selected merged mappings resolve ordinary dependencies, then flat positive-union cycles collect every reachable closed anchor. X=Y|int,Y=X|str closes both to int|str; X=Y|int,Y=Y stays unresolved because a dependent anchor does not close its unanchored dependency. Structured dependents are retried only after replacement proposals close their dependencies. Next: Retain native merged_union_cycles_collect_every_anchor and require_closed_anchors cases.",
          "evidence": [
            {
              "label": "types/constraints/resolution.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/resolution.rs#L40"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Exclude quantified locals while retaining declaration dependencies. Free-variable collection traverses quantified body and local declaration validation constraints, subtracts locals, then includes outgoing branch support. Memoization is per node and traversal charges shared solution limits. Next: Extract with local-bound dependencies and false ambient-assumption regressions, alongside quantified solver design.",
          "evidence": [
            {
              "label": "types/constraints/support.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/support.rs#L34"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Infer only supported static source-signature variables in strict relations. LazyStatic relation mode admits static unbounded ordinary TypeVars for strict callable comparisons. Non-static operands, bounded/constraint domains and nonordinary TypeVar domains decline rather than using gradual assignability as proof. Next: Compare finite caller admission with upstream #29555.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L213"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Use owned relation results for assignability queries. when_assignable consumer queries the owned constraint relation instead of constructing a private local builder. Prior contextual constructor is removed. Next: Keep upstream #30483 cache changes attributed to upstream while extracting residual consumers.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L589"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Track the full protocol receiver comparison. Checker stores optional source/target protocol comparison identity; constructors initialize none. Producer and member-level consumers are covered separately in instance-schema inventory. Next: Review together with instance-schema full receiver comparison and recursive protocol tests.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L574"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve fixed bounded TypeVars in protocol and protocol-union checks. Protocol targets can compare original bounded TypeVar receivers directly; all-protocol union targets reuse union error-context selection. Assignability through an upper bound first suppresses failed bound diagnostics and retries original receiver only when target refers to that TypeVar through aliases, preserving Self binding. Next: Extract ordinary Python recursive protocol/bounded Self fixtures.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L1510"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Skip redundant FunctionType runtime evidence in callable intersections. Relation intersection dispatch uses the same redundant nominal FunctionType rule as generic inference. Next: Unify with generic consumer extraction.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L1867"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Move existing nominal wrapper rules after supplied-instance admission. GenericAlias, method-wrapper __func__ signature comparison and functools.partial nominal conversion rules move unchanged across the new provided-instance branch. This is dispatch ordering support, not newly implemented wrapper precision. Next: Preserve original wrapper tests and verify the changed ordering.",
          "evidence": [
            {
              "label": "types/relation.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/relation.rs#L2360"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Keep logically equivalent declaration and inferred atoms distinct as evidence. PairEquivalence marks same predicate with distinct provenance as truth-equivalent. Opposite assignments conflict, but neither atom derives call-site inference evidence from a declaration. Next: Include declaration-only vs inferred-solution regression.",
          "evidence": [
            {
              "label": "types/constraints/sequents.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/sequents.rs#L129"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain shared quantified witnesses in derived consequences. PairRelation retains a complete owned relation plus provenance as a sequent consequence when existential nodes occur; splitting the body into independent atom implications would lose the common witness and its binder scope. Next: Extract with correlated local-witness consequences and negative witness-reuse cases.",
          "evidence": [
            {
              "label": "types/constraints/sequents.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/sequents.rs#L162"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Carry owned consequences and provenance through cached sequents. Sequent becomes generic over relation payload; grouped and pending storage uses the cached payload alias and cloned iteration; display renders equivalence and quantified consequences. Next: Keep only with proof semantics.",
          "evidence": [
            {
              "label": "types/constraints/sequents.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/sequents.rs#L17"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Recognize reflexive TypeVar and extremal-bound truths centrally. Central intrinsic truth test admits bottom lower bounds, top upper bounds, and same-TypeVar range/equivalence. Concrete equivalence stays nonintrinsic. Existing lower/upper checks move to this shared admission. Next: Use native provenance/domain-policy cases.",
          "evidence": [
            {
              "label": "types/constraints/sequents.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/sequents.rs#L585"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Charge witness validation against the same path and type budgets. ProjectionBudget owns one BoundedSolutionLimits and ProjectionTypeBudget; dictionary item counts charge explicitly. Native collection, witness discovery, solving and final validation share remaining resources. Diagnostic evidence and exported types are charged; incomplete witness families cannot certify validated projection. Next: Qualify exhaustion during preprocessing, terminal traversal, witness completion and exported-type accounting.",
          "evidence": [
            {
              "label": "types/constraints/projection.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/projection.rs#L23"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Verify projected candidates against the original joint relation. Fixed caller bindings constrain path discovery and final proof. Full candidate paths must be complete and valid; projection callbacks charge constructed types. Each proposed specialization is checked on the original graph, with rigid unspecialized variables; incomplete/failed fallback proof remains unknown rather than declaring unsatisfiable. Root-only atom proofs do not expand unresolved correlations or quantified nodes. Next: Add minimal ordinary solver proof examples and inspect all candidate validity/quantifier dependencies before upstream design review.",
          "evidence": [
            {
              "label": "types/constraints/projection.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/projection.rs#L172"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Imports for bounded proof and mapping support. Shared budget/proof types and mapping helpers are imported for the identified mechanisms. Next: Carry with owning changes.",
          "evidence": [
            {
              "label": "types/constraints/projection.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/projection.rs#L3"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Carry quantified consequences as whole path continuations. Path state retains activated whole relations, visiting relation guards and originating assignment fuel. Antecedent fuel minima and whole-proof budget pay relation activation cost; consequent atoms continue that chain. Pending relations cannot share plain atomic path cache keys because proof/fuel context is absent. Next: Review with complete witness scope and source-order semantics.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L64"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Scope path-local quantified TypeVars. PathAssignments stores quantified support initialized empty; with_quantified_typevars temporarily unions local binders then restores enclosing support. The same source hunk also supplies relation/fuel restoration helpers. Next: Include nested binder/ambient-domain regressions.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L77"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Detect contradictory truth assignments across provenance-equivalent atoms. Equivalent atoms are triggered by either truth value on both sides. PairEquivalence checks conflicts only and does not assign one atom from the other, preserving inference evidence provenance. Next: Extract with provenance-equivalence producer and native equivalent_provenance_conflicts_preserve_evidence fixture.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L572"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Remove atomic-only projection consequence replay. Atomic projection_source_order replay and per-discovery consequent maps are removed. Replacement quantified graph/source-order ownership is attributed to owned compaction and scoped traversal; no user-facing obsolete policy is established merely by removing the helper. Next: Review replacement convergence/source-order guarantees with owned graph and walker extraction.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L94"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Quantify domains and ParamSpec families rather than erasing atoms. reduce_inferable constructs a scoped existential with ordinary locals, P.args/P.kwargs and referenced keyword projections. Universal quantification is its negation dual and ranges over declared upper bounds/constraints. A bounded proof collapses established parametric truths to stop equivalent recursive quantifiers growing each iteration. Next: Extract quantified free/local domain examples together.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L875"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Give independent quantified bodies private binder occurrences. Track maximum freshness across local/overlaid tables. Quantify freshens bound locals and all occurrences in body/domain through shared mappings while free identities remain fixed; vacuous binders disappear. Moving storage into the existing builder preserves arenas/memo tables before rebuilt IDs escape. Next: Review freshness arithmetic/overflow and empty-scope invariants with independent copies, lazy domain and nested ParamSpec tests.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L1172"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Rebuild immediate mapped constraints without flattening quantified scopes. Source-order traversal records quantified constraints as units, sorts immediate graph constraints stably and maps each once. Source order is rebuilt from mapped immediate entries, preventing body locals escaping into a parent order. Next: Retain direct/staged mapping and recursive convergence tests.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L976"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Query graph support with a consumer predicate. referenced_typevars collects stored supported TypeVars filtered by caller predicate, used to find missing keyword-surface components. Next: Keep internal unless an external caller requires a stable public API.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L537"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Store quantified source-order scopes alongside atomic entries. SourceOrder::QuantifiedConstraint preserves a body owner; flattened atomic order queries may traverse its body, while immediate mapping keeps the scope unit. Constraint-to-atomic accessors explicitly reject existential variants. Next: Test nested body order and shared atoms.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L1569"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Freshen imported binders only when they collide with destination identities. Loader lazily rebuilds existential nodes after bodies and source-order dependencies. Imported noncolliding local names remain stable through repeated owned round trips; any local colliding with preexisting destination table re-enters capture-avoiding quantify. Provenance can be remapped for the complete imported relation. Next: Require existing quantified owned-loading/copy-independence regressions plus source-order stability. Upstream cached-relation substrate is a separate owner gate.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L1768"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Prove constants from an intrinsically true root only. A root proves a constant when terminal, or its true branch has the expected constant, uncertain branch is false and its atom is intrinsically true. This is sufficient-only and avoids unbounded traversal of mapped relations. Next: Extract with positive and negative root truth cases.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L2702"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Pass original relation and order into scoped solution traversal. Walker receives original node together with source order in ordinary and fast-path satisfiability/candidate collection. Atomic path order initialization also traverses nested existential bodies, deduplicating shared atoms. Next: Replacement walker remains a separate semantic audit gate.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L2739"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retire atom-erasing existential projection and its visitor. Old exists_cache, exists/exists_inner/abstract_inner, generic PathVisitor and individual satisfied-constraint rebuild helper are removed. Their atomic erasure/replay model is replaced by explicit binder-scoped quantification, not an obsolete user-facing host policy. Next: Review replacement semantics and benchmarks.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L1127"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Inspect both lower and upper evidence for provisional context. has_provisional_inference checks evidence_lower and all upper evidence because preliminary lower solving can discard a placeholder still retained above. Next: Reduce with upper-only provisional context cases and compare lambda/collection upstream overlap.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L3705"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain signed path obligations with private positive witnesses. CandidateResidual stores original signed relation, positive local witnesses, original caller inferables and contextual evidence policy. CandidateSolutions records inferables and whether discovery omitted branches. Ordinary simple conjunction candidates explicitly have no residual. Next: Review negative-scope obligation and local witness closure with source producer before design proposal.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L3927"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Resolve witness dependencies and revalidate each declared domain. Before replay, resolve selected mappings; anchored union closure may propose local witnesses but cannot certify them. Conjoin complete local domain constraints, specialize jointly and refuse unresolved locals still present in support. Charge hidden local types before export. Next: Native existential domain/captured alias tests are prerequisites.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L3994"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Certify selected caller outputs by refuting the original residual obligation. Replay resolves caller bindings, constructs ambient assumptions from free support, quantifies local witness scopes before caller substitution and proves the negative replay unsatisfiable under the originating placeholder policy. Closed caller values can succeed via existence without choosing every local endpoint. Next: Qualify signed obligation replay with rigid outer variables and scoped witnesses.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4088"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retry local witness inference without a rejected contextual choice. When contextual fixed caller evidence cannot extend to a witness, retry original joint relation without fixing that choice. Require a single complete residual candidate family; do not combine unrelated path endpoints. Negative-only obligations validate callers but cannot infer existential locals. Next: Add reduced context-rejected-but-valid-native-witness example and unrelated-family negative case.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4088"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Export caller bindings only after complete scoped witness replay. Only complete, valid joint solution with closed declared-domain witness and successful ambient implication replay exports bindings; locals are filtered out. Unknown witness, rejected provisional choice or incomplete family clears caller bindings and returns explicit incomplete. Next: Check no private local leaks into exported call return/context types.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4088"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Reuse limits across preprocessing, solving and witness validation. SolutionLimits is forwarded through &mut L so nested discovery/replay uses caller counters. The former compute_bounded wrapper is replaced by ProjectionBudget owners; solve/collect receive shared limits and type budget. Next: Qualify bounded witness work and the later ordinary terminal fast path separately.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4086"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain complete siblings without treating unvisited witnesses as exhaustive. Collector propagates discovery/solution incompleteness separately for valid and invalid families. A verified residual with no remaining caller bindings is unconstrained. Empty-but-incomplete families remain constrained/incomplete rather than unsatisfiable. Scoped paths discard unvalidated selections; ordinary paths may retain fallback evidence. Next: Test no-valid-path+incomplete, complete sibling and invalid-only cases against call context consumers.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4744"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Validate chosen fixed TypeVar outputs with captured callable locals in scope. Selected output types, not only original evidence, are checked against declared upper bounds. Complete captured ParamSpecs contribute callable-local generic variables existentially; still-inferable dependencies remain for joint solving. Incomplete ParamSpec inference skips upper validation because ownership is unknown and path already incomplete; deduplicate upper-bound violations. Next: Reduce native callable P/R capture and invalid fixed outer variable regressions.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4891"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Use static inferred upper context without discarding explicit literal evidence. A structured lower containing only UnspecializedTypeVar placeholders may select one complete static inferred upper as context; genuine gradual/divergent data is excluded. Equivalent static inferred upper bounds carrying explicit literal annotations are retained with the lower to prevent accidental later promotion. Next: Reduce placeholder filling and explicit literal preservation separately; compare upstream #27665 and #30483.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L5161"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Skip unchecked contextual promotion for residual witness paths. Argument-context promotion skips candidates with residual obligations because their proposed specialization requires complete witness replay. Next: Retain a native no-premature-promotion example and compare upstream collection replay proposal.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L4680"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Imports, derives and display storage plumbing. Imports support named mechanisms, redundant exhaustive-pattern attributes disappear and display gets storage for quantified nodes. Next: Carry only with corresponding semantic change.",
          "evidence": [
            {
              "label": "types/constraints.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints.rs#L92"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Distinguish certified, refuted and unresolved paths. Satisfiability and PathIs explicitly represent incomplete proofs. A certified witness settles local existence even if siblings were incomplete; the outer candidate family still records missing coverage. Failed negative-witness search is not automatically unsatisfiable. Next: Extract three-state behavior with real exhausted witness fixtures.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L57"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Memoize ordinary satisfiability only under equivalent declaration context. Proof cache key includes placeholder policy, validation support and actual validation constraints alongside explored node/path. Disable ordinary proof memoization for positive/negative binders, quantified path support, declared constraint selections and relation continuations. False results are cached only when complete; true certified existence may be cached. Next: Review cache eligibility and source-edit lifetime separately from upstream cached type relations #30483. Existing semantic-index tracked-key fix is a different producer.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L221"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Visit whole relation consequences before terminal success or pruning. Pending derived relations run positively with their fuel context and retain witness scopes through original continuation under either outer polarity. They bypass plain path memo/prune callbacks and restore original edge fuel before continuing. Next: Require correlated witness and fuel regression.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L616"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Prune irrelevant subtrees only after a three-state existence proof. Visible inferable support closes over active path and declaration-validation constraints. Irrelevant subtrees are skipped only when certified satisfiable, rejected only when refuted, and mark family incomplete otherwise. Root terminal validation still attributes failures only after no certified path. Next: Review optimization against quantified cross-variable dependencies and ordinary no-quantifier performance.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L384"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Share traversal with explicit memo, prune and terminal callbacks. Atomic traversal separates reusable cache/prune/process callbacks, parameterizes polarity and passes original relation/source-order to the walker. Never-cache/never-prune callbacks serve scopes whose continuations carry extra ownership. Atomic negative traversal delays edge union construction. Next: Verify terminal budgeting and callback ownership through scoped traversal.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L32"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Keep positive witnesses live through the outgoing continuation. Existential holding edge visits outgoing continuation then body positively under private locals and their declarations. Even negated outer nodes do not negate existential body. New derived locals get validations beyond root support; Boolean proof walks logical domains, while candidate inference preserves family/preference selection for later validation. Uncertain positive branch needs no body proof. Next: Use independent and nested quantifier regressions.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L206"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Reject existential existence only after a whole-scope proof. The not-holding branch records a negative scope only when the body is refuted under current outer assumptions. Conditional witness coverage cannot settle Boolean proof. Candidate inference may once exclude known covered witnesses, then must reprove original scope impossible; a second conditional proof stays incomplete. Next: Include conditional Free/Local examples where one witness covers only part of caller domain.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1246"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Distinguish closed quantifiers from ones depending on outer variables. Existential proof computes body-plus-local-declaration support minus locals. With no free support, ordinary domain/existence proof may settle scope. Otherwise collect complete candidate witness families while retaining free variables rigid and tracking new nested locals. Next: Check outer-bound dependency policy and nested witness declarations together.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1338"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Cover an outer path with complete witness conditions. For each candidate, select logical local endpoints where permitted, resolve and validate a whole witness against its full signed relation, then union sufficient witness conditions. Refuting the complement of accumulated coverage proves existence; failing selected choices only returns incomplete, not nonexistence. ParamSpec/tuple packs require witnesses in their own domains. Next: Need reduced multi-witness coverage and rigid-free-variable cases before upstream solver design review.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1456"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Try bounded logical endpoints for local alias cycles. If selected local alias dependencies do not close, try effective lower endpoints only for ordinary local variables with matching selected peers and no chosen finite-domain constraint. The alternate still undergoes full relation/domain replay. Next: Qualify alternate witness replay while preserving ordinary inference defaults.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1564"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Apply logical binder domains separately from inference preferences. Validations.as_constraint_set combines upper bounds conjunctively and finite declared domains disjunctively. from_locals checks only declarations owned by binder; external dependencies remain free under outer validation policy. from_support excludes caller-inferable variables where requested. Next: Review inferred vs declared constraint provenance and free declaration policy tests.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1623"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Route empty validation continuations through the ordinary terminal visitor. Empty constraint lists call visit_node_and_then on ALWAYS_TRUE with callbacks, preserving common terminal behavior instead of directly invoking continuation. Limit errors retain their distinct control-flow wrapper. Next: Reconcile later 44 terminal-budget fix.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1657"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Do not export independent bounds mentioning quantified-away locals. Candidate construction takes explicit inferable and hidden support. Constraints overlapping hidden local support are excluded from independently exported mappings; actual private witness obligations survive in a separate residual. Next: Verify excluded metadata does not remove the full residual relation.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L346"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve signed path and negative scopes for final witness replay. Signed path rebuilds ordered positive/negative atom facts and explicit negative existential scopes. Positive local candidates snapshot that signed path; negative-only candidates retain original logical relation plus negative obligations, avoiding accidental caller restriction from refinement splits. Residual records private locals, caller inferables and evidence policy. Next: Include split-refinement cases where callers satisfy both sides.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L2664"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Exercise real incomplete upper proofs and cumulative witness work. Two complete assertion bodies: fixed upper generic callable comparison reaches real witness exhaustion and produces incomplete empty candidates with no violation; repeated existential proof consumes one temporary-type budget cumulatively, yet an independent true terminal remains certified. Next: Assertions read from source.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L3290"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "Upstream existential-binder proposal #29027",
          "url": "https://github.com/astral-sh/ruff/pull/29027"
        },
        {
          "label": "types/constraints/variables.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L123"
        },
        {
          "label": "types/constraints/variables.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L222"
        },
        {
          "label": "types/constraints/variables.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/variables.rs#L301"
        }
      ]
    },
    {
      "id": "investigation:ty-cached-implication-conflicts",
      "title": "Recheck cached implications after branch rollback",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python bugfix candidate. A sibling branch can negate a rolled-back consequence while its antecedents still hold. Retriggering cached rules detects the conflict.",
      "nextStep": "Reproduce against clean upstream and qualify both single and pair implication regressions.",
      "findings": [
        {
          "text": "Recheck cached implications after branch rollback — crates/ty_python_semantic/src/types/constraints/paths.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Recheck cached implications when a sibling negates their consequence. Single/pair implications register a trigger on false consequences as well as true antecedents. After a sibling branch rolls back a derived assignment, cached rules are rechecked when the consequence is negated, detecting conflict while antecedents remain true. This does not derive inference evidence from provenance-equivalent declarations. Next: Candidate for a reduced independent solver fix. Both complete native assertion bodies were read: single implication T=object⇒str≤T and synthetic pair.",
          "evidence": [
            {
              "label": "types/constraints/paths.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L615"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/constraints/paths.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/paths.rs#L615"
        }
      ]
    },
    {
      "id": "investigation:ty-incomplete-proof-diagnostics",
      "title": "Avoid violations from incomplete upper-bound proofs",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python bugfix candidate. Exhausted generic witness proof must remain unknown instead of producing an upper-bound violation.",
      "nextStep": "Qualify the native exhausted-witness regression and reduce a Python diagnostic example.",
      "findings": [
        {
          "text": "Avoid violations from incomplete upper-bound proofs — crates/ty_python_semantic/src/types/constraints/solutions.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Do not report an upper-bound violation from an incomplete proof. inferred_lower_satisfies_upper_bound returns Option<bool>: Some true/false are proved; None marks unknown. Validation requires Some(true), while failure attribution stops on None to avoid fabricating a diagnostic violation. The real generic callable witness test exhausts temporary-type work and asserts no pending candidate/violation. Next: Qualify the exhausted-witness regression and reduce a Python upper-bound diagnostic example.",
          "evidence": [
            {
              "label": "types/constraints/solutions.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1737"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/constraints/solutions.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/constraints/solutions.rs#L1737"
        }
      ]
    },
    {
      "id": "investigation:ty-bounded-callable-relations",
      "title": "Check complete generic callable specializations",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Preserve strict callable relations while solving finite source domains, covering union inputs and comparing nested protocol receivers.",
      "nextStep": "Reduce strict callable cases; qualify domain replay and receiver progress against upstream #29555.",
      "findings": [
        {
          "text": "Check complete generic callable specializations — crates/ty_python_semantic/src/types/signatures.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Continue repeated declarations when finite receiver structure decreases. Recursion context tracks full protocol receiver pair. Explicit argument traversal includes finite aliases, generic arguments, union/intersection components but excludes recursive bodies/bounds/member expansion. Progress requires componentwise containment and at least one strict decrease, or same-origin target protocol requirement count decrease; unrecognized/growing contexts retain declaration approximation. Next: Validate well-foundedness for each progress branch and native nested iterable/protocol mismatch cases.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L961"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Admit only finite complete callable shapes for specialization. Specialization requires standard complete parameters, ordinary generic domains and no receiver constraints/ParamSpec-value shape. Static inference excludes declared domains; bounded/finite-domain path admits fully static or constrained Any forms with explicit domain checks, excluding Self. Next: Qualify finite caller admission for supported and unsupported signature shapes.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L1588"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Cover each explicit union input with a valid source specialization. Unary overload aggregation expands target aliases, excludes generic target signatures, allows each target union member its own source specialization and verifies all overlapping source returns remain safe. This is limited to one required positional input, not arbitrary overload-set combination. Next: Reduce differing source specializations per discriminated input and unsafe overlapping return counterexample.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L3342"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Infer unbounded static source binders while preserving strict relation semantics. Eager subtype/pure-redundancy comparison may enter LazyStatic for supported generic source and nongeneric target. Nested target generics or unsupported signatures decline. Existing LazyStatic is preserved through checker setup. Next: Compare finite caller admission and upstream #29555 nominal generic binding.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L3492"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Replay complete bounded source specialization under the original strict relation. With no ambient inferable variables, source domain solving may propose bindings. Target variables stay rigid; incomplete paths/dependencies decline. Missing optional source slots may retain rigid source variables. Remove generic source context only after specialization, then replay original strict relation after search recursion entry is gone. Only complete rejected family can return false. Next: Extract bounded/finite domain strict callable counterexamples, gradual declarations and incomplete search gates together.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L3775"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L961"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L1588"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L3342"
        }
      ]
    },
    {
      "id": "investigation:ty-generic-overload-consistency",
      "title": "Infer implementation types from overload inputs",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Specialize generic implementation inputs before declaration coverage checks. Broader implementation return annotations are permitted; body checking has a separate owner.",
      "nextStep": "Correct the invalid nullable-return assertion, then qualify generic declaration consistency.",
      "findings": [
        {
          "text": "Infer implementation types from overload inputs — crates/ty_python_semantic/src/types/signatures.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Check generic implementation consistency using complete input-only inference. PrepareOverloadImplementation specializes implementation variables from rigid overload parameter inputs, never promised return/defaults. Generic methods, positional varargs, Self, missing input occurrences, indeterminate replacements, incomplete inference or unresolved remaining binders decline. Nongeneric implementation may compare rigid generic overload inputs within supported shapes. Next: Qualify generic declaration consistency independently of body checking, including fixed inputs and open keyword tails.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L787"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Reject implementation inference that silently drops relevant open keyword evidence. Only paired KeywordParamSpec captures infer tail evidence jointly. Otherwise implementation variables in skipped kwargs or named slots absent from overload fixed surface decline. Coverage then erases overload generic context to keep its variables rigid after implementation specialization. Next: Use fixed-input+open-keyword positive cases and hidden evidence negative cases.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L2868"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L787"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L2868"
        }
      ]
    },
    {
      "id": "investigation:ty-returned-callable-binders",
      "title": "Keep returned callable variables bound",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Preserve callable-local binders under outer substitution and project captured callback variables before they reach ordinary results.",
      "nextStep": "Reconcile binder ownership with upstream #29553 and #29555; qualify partial and captured-return cases.",
      "findings": [
        {
          "text": "Keep returned callable variables bound — crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/signatures.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Do not leak callback-local TypeVars into ordinary call results. After applying merged specialization, captured ParamSpec signatures upper-specialize their local binders in ordinary results while returned callable binders remain owned. Callback-local defaults must not choose escaped value types. Next: Native captured callback output/default cases required.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L7392"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Preserve returned callable binders under outer projection. When preserve_callable_binders is set, locally quantified signature variables shadow an outer specialization including nested types, and mapping uses a fresh visitor root to avoid reusing transformation cache entries from the outer mapping. dfe forward changes replace this implementation with WithBoundVariables and must remain attributed. Next: Coordinate generic FunctionType #29555 and finite lambda #29553 binder ownership before extracting capture-avoiding substitution cases.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L468"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Expose declared/defaulted and upper-projected result views separately. Public APIs distinguish declared return, default-specialized return and signature-owned upper projection. Upper projection ignores defaults, preserves captured outer variables and protects binders in returned callable signatures. Next: Native source/default/captured binder examples before public API design review.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L1858"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain unsolved generic binders in partial callable returns. Promoted partial variables select retained binder when unsolved, promoted override when inferred; other variables use inferred projection. This replaces overloading None/Some with explicit Retain semantics. Next: Extract partial return generic capture examples with unresolved dependencies and defaults.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L2813"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/call/bind.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L7392"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L468"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L1858"
        }
      ]
    },
    {
      "id": "investigation:ty-generic-call-expansion",
      "title": "Preserve viable generic argument expansion",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python bugfix candidate. Keep overload expansion available when some generic specialization accepts an argument, including provisional arity mismatches.",
      "nextStep": "Qualify the bound-method starred-union fixture and reduce the generic expansion precheck.",
      "findings": [
        {
          "text": "Preserve viable generic argument expansion — crates/ty_python_semantic/src/types/call/bind.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Attempt argument expansion when some generic specialization can accept an argument. Expansion precheck changes forall-compatible to not-never-compatible under inferable TypeVars. A nonconstant relation need not be always true to have viable argument expansion; only proven impossibility permits skipping. Next: Reduce ordinary generic-overload union input case and compare upstream baseline.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L4411"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/call/bind.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L4411"
        }
      ]
    },
    {
      "id": "investigation:ty-native-getattr-context",
      "title": "Infer finite getattr results and empty defaults",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Python enhancement candidate. Use finite member facts for getattr results and fresh empty defaults. Immutable storage guarantees have a separate host contract.",
      "nextStep": "Reduce ordinary Python lookup cases; compare collection context with upstream #27665.",
      "findings": [
        {
          "text": "Infer finite getattr results and empty defaults — crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/call/checked.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Infer finite runtime getattr results without hiding descriptor failure. Known getattr resolves literal names/unions through runtime attribute policy, preserves missing alternatives, declines dynamic/indeterminate results and joins explicit default unless immutable storage proves it unreachable. Known hasattr returns true only on error-free immutable stored paths. Next: Split general finite-getattr precision from host immutable-storage default elision. Add descriptors that raise AttributeError and union receiver negative cases.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L2852"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Contextualize a fresh empty getattr default from finite member facts. Only matched builtin getattr third parameter with complete static finite member facts and compatible nominal/protocol collection domains supplies preference context. TypedDict domains are excluded because empty literals may omit required keys. Actual default is still joined after inference. Next: Separate from ordinary lookup precision when reducing.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L9769"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Require applications to establish native getattr operation identity. getattr_return_type declines binding errors/bound receivers and uses already matched object/name/default operands; host chooses actual native operation declaration and contract. Next: Verify the actual native operation declaration in every host caller.",
          "evidence": [
            {
              "label": "types/call/checked.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/call/bind.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L2852"
        },
        {
          "label": "types/call/bind.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L9769"
        },
        {
          "label": "types/call/checked.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/checked.rs#L1"
        }
      ]
    },
    {
      "id": "investigation:ty-keyword-paramspec-host",
      "title": "Define keyword-only ParamSpec host contracts",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host API design. Distinguish accepted keyword parameters from received keyword dictionaries, then verify complete ParamSpec witnesses against the original call relation.",
      "nextStep": "Specify host annotation and capture semantics before proposing shared solver APIs.",
      "findings": [
        {
          "text": "Define keyword-only ParamSpec host contracts — crates/ty_python_semantic/src/types/call/arguments.rs, crates/ty_python_semantic/src/types/call/bind.rs, crates/ty_python_semantic/src/types/signatures.rs, crates/ty_python_semantic/src/types/typevar.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Distinguish accepted keyword parameters from received keyword dictionaries. ParamSpecProjection distinguishes ordinary attributes, keyword-parameter surface and captured keyword arguments. Accepted parameters have Mapping[str, object] bounds; runtime captured dictionaries and P.kwargs have dict bounds. Exact component mappings precede base substitution; a base replacement carries its projection onward. Next: Specify KeywordParamSpec host contracts and general ParamSpec component rules separately.",
          "evidence": [
            {
              "label": "types/typevar.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1100"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Retain optional keys and residual exclusions during argument binding. Observed keyword arguments keep source expression types plus exact snapshot entries and residual tail. Required names, expansion, key lookup and synthetic TypedDict conversion consume this metadata; ordinary source types remain available. Next: Include call-time mutation snapshots and optional/missing/residual examples.",
          "evidence": [
            {
              "label": "types/call/arguments.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L201"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Distinguish fixed keyword ParamSpecs from inferable empty captures. Caller-fixed ParamSpec keyword captures may require arguments even with no visible slots. Callee-inferable captures may resolve to empty complete signatures. Missing capture diagnostics keep correct base parameter ownership. Next: Review extension semantics separately from ordinary Python P.args/P.kwargs forwarding.",
          "evidence": [
            {
              "label": "types/call/bind.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L6496"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Substitute captured keyword surfaces without importing positional parameters. ParamSpec mappings project a keyword capture into accepted keyword-only inputs, preserve source receiver contracts and enclosing generic context, and decline unavailable projection. Forwarded ParamSpec helper unifies ordinary args/kwargs and host keyword capture paths. Next: Review KeywordParamSpec host extension independently of ordinary Python ParamSpec fixes.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L332"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Relate finite and symbolic callback keyword remainders. Lazy callable relation captures finite source remainder into readonly accepted-keyword shape, or relates symbolic tails only with equal fixed key sets. Add upper constraints on target keyword-parameter projection; positional behavior remains outside this evidence. Next: Separate host annotation design from general solver support.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L4151"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Construct complete callable witnesses for keyword-only parameter evidence. Keyword projection handles positional-only prefixes and symbolic tails, gradual tails become incomplete keyword descriptions, top projects to Never. Closed TypedDict schema can propose a keyword-only ParamSpec witness; open schema declines. Fixed source names are excluded from remainders. Next: Only a candidate constructor: verify the complete original call relation before exporting inferred ParamSpec.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L6502"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/typevar.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/typevar.rs#L1100"
        },
        {
          "label": "types/call/arguments.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/arguments.rs#L201"
        },
        {
          "label": "types/call/bind.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/call/bind.rs#L6496"
        }
      ]
    },
    {
      "id": "investigation:ty-parameter-source-provenance",
      "title": "Preserve synthesized parameter source locations",
      "group": "ty",
      "owner": "Agent",
      "task": true,
      "status": "active",
      "updatedAt": "2026-11-28T10:16:45+00:00",
      "summary": "Host API design. Keep source definitions or ranges through parameter specialization, default presentation and hidden internal keyword handling.",
      "nextStep": "Review the public source-location contract and qualify navigation and signature presentation.",
      "findings": [
        {
          "text": "Preserve synthesized parameter source locations — crates/ty_python_semantic/src/types/signatures.rs",
          "evidence": [
            {
              "label": "dfe98a7daef8d3e8076f20e55ece2f4a98769331",
              "url": "https://github.com/tamird/ruff/commit/dfe98a7daef8d3e8076f20e55ece2f4a98769331"
            }
          ]
        },
        {
          "text": "Preserve synthesized parameter provenance through mappings and expansion. ParameterSource stores canonical Definition inline or shared FileRange for synthesized donor slots. Expansion, specialization, recursive normalization preserve source; definition accessor excludes raw-range sources. This supports navigation without inventing semantic definitions. Next: API design with source-location tests and normal parameter clone/size behavior.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7183"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Accept internal optional keywords while hiding them from presented signatures. Implicit keyword-only constructor adds optional Unknown default and implicit flag. Call checking and relations still include the parameter; display/index mapping consumes the flag separately. Mapping/cycle normalization preserve flag. Next: Keep internal inputs out of user-visible presentation without changing runtime acceptance.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7383"
            }
          ],
          "sourceInventory": true
        },
        {
          "text": "Keep inferred default type with its original source expression. ParameterDefault::Source retains FileRange alongside inferred type, participates in direct/eager/mapped type access and recursive normalization, and public default setter accepts inferred/source-backed values. Named parameter raw default inference is split from existing signature cycle-breaking replace-default operation. Next: Preserve actual runtime source defaults vs donor optionality.",
          "evidence": [
            {
              "label": "types/signatures.rs",
              "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7531"
            }
          ],
          "sourceInventory": true
        }
      ],
      "evidence": [
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7183"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7383"
        },
        {
          "label": "types/signatures.rs",
          "url": "https://github.com/tamird/ruff/blob/dfe98a7daef8d3e8076f20e55ece2f4a98769331/crates/ty_python_semantic/src/types/signatures.rs#L7531"
        }
      ]
    }
  ]
}
