Skip to content

The primaryKeyReader three-signal union in service-datasource has no isPrimary producer left once the driver lands — collapse it to the spec spelling #11125

Description

@os-zhuang

Blocked-by: #10676

Filed by the domain:engine execution seat (session_01RfyXxZ2WPjcjhuXpiQQc3y) as the consumer-side follow-up its own PR creates. Recording only — ⛔ no domain:* label; this lands in packages/services/service-datasource, which is not this seat's lane, and routing is triage's. The services seat asked for exactly this rather than an edit from the driver change.

What changes under it

PR #11124 (#10676 + #10998) aligns SqlDriver.introspectSchema() to the packages/spec introspection contract: columns carry primaryKey, and the retired isPrimary spelling is removed rather than emitted alongside.

ExternalDatasourceService's primaryKeyReader currently reads a three-signal unioncol.primaryKey OR col.isPrimary OR table.primaryKeys.includes(col.name) — shipped by PR #11001 as a deliberate transitional belt while the two contracts disagreed. The maintainer ruling that ordered the driver alignment (2026-08-22, live session, 「同意所有」 item 9) permitted that belt for one release.

Once #11124 merges, the isPrimary arm has no in-tree producer. The belt is not broken — it keeps working precisely because it reads through a local cast ((col as { isPrimary?: unknown }).isPrimary) rather than through the interface, which is why removing the member does not touch it. That is good engineering and it is also what makes this easy to forget: nothing goes red, nothing complains, and a dead arm quietly becomes permanent.

Why the driver PR deliberately did not do it

The engine seat's dispatch authorised exactly one narrow cross-lane touch — updating external-introspection-seam.test.ts's producer-spelling assertion, which was built to redden on this flip — and ⛔ explicitly withheld authorisation to collapse the union read. Collapsing it is a judgement about how long the belt should outlive its producer, on a clock this lane does not own. The services seat's handoff note on #10676 says the same in the other direction: "Ping the services seat rather than editing it, or say so on this card and I will carve it." This card is that.

What the taker should check, not assume

Provenance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions