Skip to content

[finding] a fourth tolerant alias reader — master-detail.ts accepts referenceTo, with its stored-row population asserted but never measured #13543

Description

@claude

Found while implementing #13250 (the two remaining tolerant reference_to readers). Filed unassigned, out of scope for that card's PR — #13250's table named three readers and this is not one of them.

What is there

packages/objectql/src/master-detail.ts:58

const raw = def?.reference ?? def?.referenceTo;

with the tolerance declared in the type just above it:

/** Canonical reference target. `referenceTo` is the stored-row spelling. */
reference?: string;
referenceTo?: string;

This is a fourth live reader accepting a spelling FieldSchema rejects, after the three #13250 enumerated. It reads referenceTo only, not the snake_case reference_to.

Why this is an observation rather than a defect claim

Unlike the three on #13250, this one is not silent about being tolerant — it declares the alias in its own interface and states a population for it: "referenceTo is the stored-row spelling." That is exactly the shape the maintainer ruling on #13250 blessed for the security reader, so the tolerance may well be correct here too.

What is missing is the measurement behind the claim. The comment asserts that stored rows spell it referenceTo, and nothing in the tree measures whether that is still true, or how many such rows exist. So the question for triage is narrow:

  1. Is the asserted stored-row population real and non-empty today?
  2. If yes, this reader stays as-is and should say so the way the security reader now does after fix(security,verify): keep the security reference-alias read tolerant but LOUD, narrow verify with a named finding #13541 — the tolerance recorded with its measurement, and loud where the alias is what answered.
  3. If no, this is the same dead-tolerance shape [finding] docs vs driver disagree on whether lookup columns get a real FOREIGN KEY — and the driver branch keys on reference_to, not reference #11567 closed elsewhere, and it narrows to canonical-only.

⚠️ Before narrowing, check the failure mode the way #13250 had to: what does this resolver returning null cost its callers? If any of them fail closed, narrowing is an availability question and not a spelling question, and the answer is a migration first.

Related

#13250 (the three readers and the split ruling) · #13541 (the two dispositions landing) · #11567 (reference is the only spelling the spec declares)


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions