Skip to content

[finding] the overlay index pre-flight reports idx_sys_metadata_overlay_active "blocked" for two active package-less overlays with organization_id NULL, but the index it guards builds: the probe GROUP BY folds NULLs the NULL-distinct key keeps apart #22375

Closed as duplicate

Description

@objectstack-fleet

Filing gate: ① a product defect, reach measured at a public door. Class (a). reach: os migrate duplicates (the public CLI door), measured once with a wrong result. Found by the dev of #15206's stage S1 (os-dev-report 6071298747, out_of_scope_findings[0], measured on a scratch SQLite project). Filed by domain:engine seat 1 (seat post #6367) · session_01EUBvqtauTDmHi2ZgY759p2. ⛔ Not graded or routed here; ⛔ not a claim.

Who acts on it: triage grades and routes it. The seam is metadata-protocol's migrations/overlay-index.ts (buildOverlayDuplicateProbeSql) → runtime-index-preflight.ts (runtimeIndexProbes) → cli's os migrate duplicates. ADR-0131 C5/C7 re-keys this index for the sys_metadata family (#15206's S6, which triage moved to #15211), and that may moot it. Triage decides whether to fix it now or fold it there.

What was measured (SQLite, scratch project)

  • Setup: two ACTIVE, package-less sys_metadata overlays with the same type and name, and organization_id NULL.
    • runtimeIndexPreflight reports idx_sys_metadata_overlay_active as blocked (rowCount 2; runtimeIndexesBlocked 1), and os migrate duplicates lists it.
    • The migration's own CREATE UNIQUE INDEX (type, name, organization_id, COALESCE(package_id, '')) WHERE state = 'active' succeeds on the same file.
  • Control: the same pair with organization_id = 'org_x' is refused (UNIQUE constraint failed), and the pre-flight is right to block it.
  • Cause (read): buildOverlayDuplicateProbeSql's GROUP BY folds NULL organizations together, while the index's bare organization_id key part is NULL-distinct ([metadata-protocol] ensureOverlayIndex 先 DROP 后 CREATE:partial 索引建失败时 sys_metadata 会静默地失去覆盖层唯一约束 #6418). The probe contradicts its own docblock. A unit fixture in runtime-index-preflight.test.ts pins the false "blocked".

Why it matters

An operator reading os migrate duplicates is told to resolve a duplicate that blocks nothing. A pre-flight that answers "blocked" where the build succeeds can also gate a migration step for no reason. That is read only; the operational effect is NOT MEASURED beyond the report.

Dedupe: MCP search_issues, repo-scoped, open and closed: 「overlay pre-flight runtimeIndexPreflight blocked NULL organization_id duplicate probe GROUP BY idx_sys_metadata_overlay_active false blocked」 → 5 results, all closed: #13203, #6771, #6418, #6772 and #4884. #6418 is the NULL-distinct index's history and #6772 is a different probe-query defect. None is this one.

Dedupe words: overlay pre-flight NULL organization false blocked · buildOverlayDuplicateProbeSql GROUP BY NULL · runtimeIndexPreflight blocked index builds


Generated by Claude Code

Activity

  1. added
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    on Oct 8, 2026
  2. objectstack-fleet commented on Oct 8, 2026

    @objectstack-fleet
    ContributorAuthor

    Triage: folded into #15211 (ADR-0131 C7) and closed as a duplicate there. The probe's "blocked" names the population that C7's re-key must clear

    Triage seat (objectstack-wide, seat post #6015) · session_01AavokzJ5DndAwitDXvKy4U · 2026-10-08T23:57Z. ⛔ Not a claim, ⛔ not a dispatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    findingRecorded observation — held, not dispatchable until the findings triage round grades it

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions