Skip to content

bug(skills): the marked data-integration.md example calls .find on an unguarded dataSource — a true positive the objectui#7912 narrowing made visible, and the one thing holding PR objectui#9310 #9311

Description

@os-tesla

Routed to the domain:skills lane by the domain:ui PM seat (os-tesla) at R32. ⛔ Not claimed, not edited — published skills/** is a governed surface and neither this seat nor the os-dev seat that found it may touch it.

⚠️ This is currently the one thing holding PR objectui#9310 (card objectui#7912, the maintainer-ruled DataSource narrowing from decision batch #68). The fix is one line.

The defect

skills/objectui/guides/data-integration.md, the marked example under "Via DataSource methods (in plugin code)" — read verbatim on origin/main:

<!-- os:check -->
```typescript
import { useSchemaContext } from '@object-ui/react';

function MyPlugin() {
  const { dataSource } = useSchemaContext();

  const loadData = async () => {
    const result = await dataSource.find('contacts', {

dataSource is destructured and .find is called on it with no guard.

Skill Example Check on PR objectui#9310 reports exactly one finding:

[semantic] skills/objectui/guides/data-integration.md:304:26
  TS18049: 'dataSource' is possibly 'null' or 'undefined'
Semantic phase: 14 of 14 ts fence(s) judged, 1 failed

⭐ It is a TRUE positive, not a gate artefact — and that is the part worth reading

useSchemaContext() throws only when there is no PROVIDER. A provider with no adapter bound is a perfectly real state — ⭐ and PR objectui#9310 contains two instances of it, both pre-existing and both corrected in that PR (a react page and apps/site/app/components/LiveSplitDemo.tsx, each of which had been injecting a truthy empty-object stand-in for "no adapter").

⇒ this guidance, copied into a plugin on such a surface, throws at the first call. The published example teaches an unguarded read of a member that can legitimately be absent.

⚠️ Before objectui#7912 the member was typed any, so the compiler had nothing to say and the example compiled. The narrowing did not create the hazard — it made it visible.

Minimal repair

One line inside the fence:

if (!dataSource) return [];

Do not take the gate's other option (dropping the os:check marker). The example is meant to compile, and it only needs the guard the contract now requires. Removing the marker would retire the coverage rather than fix the guidance — and would leave the same unguarded pattern published for readers to copy.

⛔ Why it is routed rather than folded in

Measured with the repo's own tool, quoted because it is the whole routing argument:

  • node scripts/check-governed-queue-guard.mjs --test on PR objectui#9310's diff ⇒ "NOT GOVERNED — an ordinary pull request".
  • the same diff plus this one file"One governed path governs the WHOLE pull request", with draft-park and an authorized APPROVED review required.

⇒ adding a one-line docs fix to that PR would convert a clean ordinary PR into a governed, draft-parked one needing human review. ⭐ That is a real cost and it falls on the wrong lane. The os-dev seat diagnosed it, reproduced it verbatim, confirmed the harness is sound (--self-test exit 0, 59 cases pass, so a permanently-green harness is ruled out) and then stopped — which is the fence working.

⚠️ What holding this costs, stated plainly

Branch protection on main lists 0 required status checks (read this round), so Skill Example Check being red does ⛔ not mechanically block PR objectui#9310's merge queue. I am holding it anyway: landing a PR that leaves a check red on main is how a lane becomes blind rather than merely red — objectui#9271 measured exactly that, six consecutive commits with the coverage thresholds never evaluated. ⛔ I am not starting a second one.

⇒ ⭐ once this lands, PR objectui#9310 goes green and merges. Until then it waits.

Related

objectui#7912 / PR objectui#9310 (the ruled narrowing, held on this) · decision batch #68 (the ruling) · objectui#9271 (why a red check is not left on main) · objectui#6596 (domain:skills, machine-enforcing human review on governed paths)


Generated by Claude Code

Activity

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

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