Skip to content

fix(lint): spell the runtime-gate fixture's master_detail reference as the string the spec declares - #13102

Merged
os-elon merged 1 commit into
mainfrom
claude/issue-13053-reference-carrier-fixture
Aug 29, 2026
Merged

fix(lint): spell the runtime-gate fixture's master_detail reference as the string the spec declares#13102
os-elon merged 1 commit into
mainfrom
claude/issue-13053-reference-carrier-fixture

Conversation

@os-elon

Copy link
Copy Markdown
Collaborator

Fixes#13053

packages/lint/src/runtime-gate.object-writes.test.ts carried a master-detail
fixture spelling its relationship target as an object carrier:

invoice: {type: 'master_detail',reference: {object: 'shop_invoice'}},

FieldSchema.reference is declared {"type":"string"}, so that carrier is a
document the spec would refuse. The one-line fix spells it reference: 'shop_invoice'.

The value of this card is the measurement half, so all of it is below. Every
number was produced on this branch; nothing is relayed from the card.

The refusal, measured in both directions

The card quoted a safeParse error. Rather than relay the quotation, both
carriers were run through ObjectSchema.safeParse (spec 17.2.0) in one process:

carriersafeParseissue
reference: { object: 'shop_invoice' }success: falseinvalid_type at fields.invoice.reference — "Invalid input: expected string, received object"
reference: 'shop_invoice'success: true

The quoted string reproduces exactly, and the repaired fixture parses. A
one-sided green would have measured nothing.

The change is NOT inert — the finding's rendered text moves

The card argued the fix is inert because refOf() returns undefined for the
object carrier. That is true of the reader, but not of the output. refOf
feeds firstMasterDetailField, whose parent becomes parentText inside the
security-master-detail-ungranted message and hint. Both carriers were run
through runRuntimeAuthoringRules in one process:

observablebeforeafter
errors / advisories count0 / 10 / 1 — unchanged
finding path (the asserted field)objects.shop_invoice_line.fields.invoiceunchanged
rule orderingsingle findingunchanged
finding message(master_detail "invoice")(master_detail "invoice" -> "shop_invoice")
finding hint...that already grants its master --...that already grants its master "shop_invoice" --

So no assertion moves and the suite stays green, but the advisory now names the
master an author has to grant alongside the detail. The invalid fixture was
suppressing that name. That is the card's real content.

Re-census on today's main

The card's "only occurrence" claim was re-measured on this tree with the
TypeScript compiler API, over 5,593 files, excluding generated declaration
artifacts (packages/spec/json-schema/**, where reference is a property
name
whose value is a schema; packages/spec/liveness/**; generated i18n
translation maps — all three are reference as a map KEY, not a carrier).

A carrier is a reference whose enclosing object literal also carries type,
i.e. a field definition.

carrier kind at field-def positioncount
string451
object0 (1 before this fix)
array0
other (non-literal)17

Positive control: re-running the same instrument with the pre-fix copy of the
file appended returns object: 1 and names it, so the zero is a reading and
not a broken scan.

The 17 other decompose to zero defects: 6 Zod schema declarations in .zod.ts
(the definition itself), 4 runtime pass-throughs in product code, 3 identifiers
that are string constants (PARENT = 'os11431_parent',
ACCOUNT = 'showcase_account', one template literal), and 4 reference: null
in solution-blueprint.test.ts, which is spec-legal there —
SolutionBlueprintStrict declares z.string().nullable().

The card's census holds: this was an instance, not a class. The card's 587
bare-string carriers were counted across both trees; 451 is this tree's share.

Typecheck is NOT MEASURED here, and there is nothing to measure

pnpm --filter @objectstack/lint typecheck exits 0, but --listFiles shows its
program contains 0 occurrences of the edited file — packages/lint/tsconfig.json
excludes **/*.test.ts. The control (src/validate-security-posture.ts) is
present once in the same listing, so that zero is a reading.

It is also moot for this diff: runRuntimeAuthoringRules types the fixture as
objects?: readonly unknown[], so both spellings are equally valid unknown
and no type constraint exists in either direction. Reported as NOT MEASURED
rather than green. 24 of 72 package tsconfigs carry the same exclusion, so this
is a standing repo condition, not something this card introduced.

Changeset

Deliberately none; skip-changeset applied. Derived, not asserted: the diff
touches only src/*.test.ts, packages/lint declares
files: ["dist","README.md","CHANGELOG.md"], packages/lint/dist/ contains no
test artifact, and check:published-files states its own verdict as "69
publishable package(s) ... declare a files whitelist that covers every entry
point plus CHANGELOG.md and admits no test, test-harness config or build
script". Nothing here is published, so nothing is released.

Verification

All at final commit 4e2a28865c, gate family derived by
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack on a
synced tree (an earlier derivation printed STALE TREE and still exited 0; the
branch was rebased onto e9c1055ea2 and re-derived).

  • pnpm --filter @objectstack/lint exec vitest run — 81 files, 2297 passed,
    5 skipped. Identical before and after the fix.
  • 11 gates green, each quoted from its own verdict line, not from $?:
    check:published-files, check:objectql-double-limit,
    check:cross-package-test-inputs, check:test-source-alias,
    check:engine-double-contract, check:where-matcher, check:nul-bytes,
    check:query-options-erasure, check:type-source-resolution,
    check:slot-lookup, check:page-declaration-shape.
  • Every ratchet among them reports "baseline key set verified against e9c1055:
    no files added", confirming they ran against the rebased base.

Generated by Claude Code


Generated by Claude Code

…s the string the spec declares
`runtime-gate.object-writes.test.ts` carried `reference: { object: 'shop_invoice' }`
at a field-def key position. `FieldSchema.reference` is declared
`{"type":"string"}`, so `ObjectSchema.safeParse` refuses that carrier with
`invalid_type` at `fields.invoice.reference`, and the rule under test reads it
through `refOf()`, which accepts only a string and so resolved the master-detail
parent to `undefined`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CPrUz21stTFhJRUirdc4yw
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json d48929efe794b467c169825ecb68a2d015f09d8dpackageMentionDocs.

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

Labels

skip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finding(lint): a runtime-gate test fixture spells reference: { object: ... }, a carrier ObjectSchema refuses and the rule's own reader ignores

2 participants

@os-elon@claude