Skip to content

fix(lint)!: refuse a lookupFilters $record path to a structured field - #38096

Merged
os-zhuang merged 9 commits into
mainfrom
claude/issue-34562-record-structural-lint
Nov 28, 2026
Merged

os-zhuang merged 9 commits into
mainfrom
claude/issue-34562-record-structural-lint

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34562

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no page under skills/ teaches a $record path to a structured field (the two $record samples in skills/objectstack-data/rules/field-types.md read a date and a lookup hop to a select)

维护者速读

  • 用户能看到什么变化:元数据作者在查找字段的过滤条件里,把"取当前记录的值"指向地址、JSON、重复组这类结构型字段时,校验会直接报错并给出改法;用户界面无变化。
  • 为什么做:延续上一张"多值字段不能作单值比较"的修复,结构型字段同样没有单个可比较的值,以前校验放行、过滤看似生效实则不生效。
  • 出错会怎样:最坏情况是作者原本能保存的这类写法现在被拒,需要改指向单值字段;撤回本改动即可恢复放行。
  • 要你做什么:无。

What changes

object-field-ref-unknown, position lookupFilters[N].value.$record: a path whose HEAD (a plain path) or LEAF (behind one single-valued relationship hop) is a structured field is now refused, beside the multi-valued refusal and with the same hint (singleValuedPrescription, unchanged). The set is STRUCTURED_JSON_TYPES imported from @objectstack/spec/data, never re-listed. The verdict names it a structured field; the multi-valued verdict text is byte-identical.

A hop THROUGH a structured head (s_address.city) was already refused as the family's "not a relationship" miss and still is, once (pinned).

ADR-0087: a new semantic ledger entry lookup-filter-record-path-structured-refused (packages/spec/src/migrations/entries/semantic/19.lookup-filter-record-path-structured-refused.ts, filed under protocol major 19 (PROTOCOL_VERSION 19.0.0, the 18.x line is released, so an 18. file would be skipped on --from 18); registry.ts is generated and untracked), and the changeset carries adr-0087: registered lookup-filter-record-path-structured-refused plus a @objectstack/spec patch line.

Docs: content/docs/data-modeling/relationships.mdx listed only the unknown-path refusal; its sentence now also names a path whose first field, or leaf behind the hop, is multi-valued or structured.

Files: packages/lint/src/validate-object-field-refs.ts, packages/lint/src/validate-object-field-refs.test.ts, packages/spec/src/migrations/entries/semantic/19.lookup-filter-record-path-structured-refused.ts, content/docs/data-modeling/relationships.mdx, .changeset/34562-record-structural-lint.md.

Read first (by risk):

  1. validate-object-field-refs.ts, multiValuedSegment — the predicate now returns the noun (what); multi-valued is tested first so its findings keep their wording.
  2. validate-object-field-refs.ts, the singleValued refusal block — the message interpolates what.
  3. The new describe('a path to a structured field (#34562)') block in the test file.

Tests

  • New block beside the multi-valued block: it.each over every member of STRUCTURED_JSON_TYPES at the head and at the leaf (14 cases), each asserting the rule id, the full message and the full hint text; a coverage case that the five the card names are members; a CONTROL case (scalar head and leaf beside the structured fields) that stays clean; the hop-through case.
  • Red without the fix: restoring the source file to the merge base turns exactly the 14 head/leaf cases red (Tests 14 failed | 134 passed (148)), control, coverage and hop-through stay green; restored.

Acceptance notes

  • S1 → follow-up lint: os lint --explain object-field-ref-unknown and the $record describes name only the multi-valued refusal, not the structured-field one #38141 (the os lint --explain text and the $record describes).
  • The other 18. ledger entries that landed after the protocol moved to 19 are out of this diff → spec migrations: three ADR-0087 semantic entries landed under protocol major 18 after PROTOCOL_VERSION moved to 19, so os migrate meta --from 18 never shows them #38142.
  • composite and record (in the spec set, not in the card's five) are kept: composite values parse as z.record(z.string(), z.unknown()) (field-value.zod.ts), record is a name-keyed map of sub-objects (field.zod.ts), and filter-cross-field-comparison-class.ts already classes the whole STRUCTURED_JSON_TYPES set as list-or-object, no comparison class. Neither has a scalar value.
  • The hint is the multi-valued one verbatim ("a multi-valued field holds a list"), per the ruling; it reads slightly off for a structured field. Not reworded here.
  • The verdict says a structured field, not a structured TYPE field: the type-named form put two fixture verdicts over the file's 200-character one-line ceiling.
  • Measured first-party exposure, git grep -n '\$record' origin/main -- examples packages/platform-objects packages/plugins skills at 815e882: 18 hits, zero lookupFilters $record paths to a structured field (the two lookup-filter hits are the skills samples above; the rest are flow $record variables in plugin-approvals).
  • Docs read against the new refusal: content/docs/data-modeling/fields.mdx (its $record passage states no refusal list and teaches only quote_date) still holds; content/docs/data-modeling/relationships.mdx named only the unknown-path refusal and is corrected in this PR.
  • CI at 9c2f41e: the red TypeScript Type Check and Test UI rollups were their lanes cancelled (run 46096909426 and 46096909327 concluded cancelled when the next push superseded them), not failures; no re-run requested.

Verification

Two-minute check: pnpm --filter @objectstack/lint exec vitest run src/validate-object-field-refs.test.ts -t "structured field" — expect 17 passing tests.

Readings at head 9a9f0e6
  • pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test: VERDICT command-exit 0, Test Files 244 passed (244), Tests 9873 passed (9873).
  • node scripts/check-adr-0087-registration.mjs --base origin/main: exit 0, [bang+clause-②-narrowing+metadata-protocol-narrowed] registered lookup-filter-record-path-structured-refused (new here).
  • Registry regenerated by pnpm --filter @objectstack/spec build (exit 0); check:spec-changes, check:upgrade-guide, vitest run src/migrations (207 passed) and the cli migrate-meta-engine-guidance.test.ts (3 passed) green. Probe on the built dist: composeMigrationChain(18) now includes lookup-filter-record-path-structured-refused (it did not under the 18. name).
  • Full dogfood battery, pnpm --filter @objectstack/dogfood test after building its closure: VERDICT command-exit 0, Test Files 490 passed | 3 skipped (493), Tests 4144 passed | 68 skipped (4212).
  • Measured exposure: git grep -n '\$record' origin/main -- examples packages/platform-objects packages/plugins skills at 815e882, 18 hits, zero lookupFilters $record paths to a structured field.

Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 6 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/fields.mdx (via quote_date (literal, a string literal in replacement))
  • content/docs/data-modeling/relationships.mdx (via quote_date (literal, a string literal in replacement))
What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • 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.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 177 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 581ae76a23c6b3ba8e2b69e7d8a920838bc51194 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from fa5ee72f2390efe2d2410ce6e4d73c2e0ffc4277 — the merge of head 9a9f0e6421d9675916ebe74684004b1d3d8f6a00 into base 581ae76a23c6b3ba8e2b69e7d8a920838bc51194, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin fa5ee72f2390efe2d2410ce6e4d73c2e0ffc4277 && git checkout fa5ee72f2390efe2d2410ce6e4d73c2e0ffc4277
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 581ae76a23c6b3ba8e2b69e7d8a920838bc51194 9a9f0e6421d9675916ebe74684004b1d3d8f6a00 && git checkout -B drift-repro 581ae76a23c6b3ba8e2b69e7d8a920838bc51194 && git merge --no-ff 9a9f0e6421d9675916ebe74684004b1d3d8f6a00

node scripts/docs-audit/affected-docs.mjs --json 581ae76a23c6b3ba8e2b69e7d8a920838bc51194

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 581ae76a23c6b3ba8e2b69e7d8a920838bc51194 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head c0deeb3 · 2026-11-28T04:09Z

The lane seat runs the owed CONTRACT_REVIEW_TIER review (faces: Clause-②: no (narrowing) and a published-schema path, the ADR-0087 ledger entry) through an isolated at-tier subagent.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c0deeb35cc1bf12b674a57d5490dfe1f4a2ee4bc
Local-runs: none
Scope: packages/lint/src/validate-object-field-refs.ts, packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-structured-refused.ts, packages/lint/src/validate-object-field-refs.test.ts + read, not reviewed: packages/spec/src/data/field-value.zod.ts, packages/spec/src/data/field.zod.ts, packages/spec/src/data/filter-cross-field-comparison-class.ts, packages/spec/src/data/filter-comparand-type.ts, packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts, packages/spec/src/migrations/entries/README.md, packages/spec/src/migrations/registry.ts.template, packages/spec/src/migrations/chain.ts, packages/spec/src/kernel/protocol-version.ts, packages/lint/src/rule-explanations.ts

Inputs: card #34562 (body and all 7 comments), PR #38096 (body, 5 files, net diff against main, merge base f72f335), the check-runs on the head.

① Derived judgments

  • Accept set, object-field-ref-unknown at lookupFilters[N].value.$record: a path that resolves and whose head (plain path) or leaf (behind one single-valued hop) is declared with a type in STRUCTURED_JSON_TYPES moves from clean to an error. Right. The predicate is the spec's own set, imported and not re-listed, and it is reached only on a path the family's resolution did not already refuse (!hit), so no path gains a second finding.
  • All seven members, each read in fieldValueSchema (field-value.zod.ts): location and address are closed objects; composite and record are z.record(string, unknown); repeater is an array of records; vector is an array of numbers; json is z.unknown(). Six of the seven can never hold one scalar. json is the open one: a json column may hold a bare string or number, and for that one stored shape the old accept set could have produced a working comparison. The refusal is still right by declared type: the spec already classes the whole set as list-or-object, "not one comparable value" (filter-cross-field-comparison-class.ts, the $field side of the same comparison), and the server's accepted comparand set is string, number, bigint, boolean, null or Date (filter-comparand-type.ts), so an object or a list sent under one of the six scalar operators has no declared reading. Keeping composite and record, which the card's five did not name, is right.
  • Multi-valued verdicts: unchanged. nonScalar tests isMultiValueField first, and the message interpolates the noun where the literal stood; the pre-existing multi-valued tests are untouched in the diff and green on the head.
  • Hop through a structured head (s_address.city): still the family's "not a relationship" miss, once. The new goes through arm for a structured head is unreachable behind !hit; harmless.
  • Not judged, as before: a registry-injected column and a leaf on an object outside the stack.
  • Public surface: no export added, renamed or removed in packages/lint. The return type that gained what belongs to a closure-local function. packages/spec gains one ledger entry and no schema, key or describe change.
  • Migration ledger: one new semantic entry, id lookup-filter-record-path-structured-refused. Its content is right; the step it is filed under is wrong (M1 in ④).

② Semver level

Clause-②: no (narrowing) — present line-initial in the PR body and in the changeset, with Metadata-protocol: narrowed beside it; the two agree.

③ Boundary flags

  • Dev flag, composite and record kept: answered, right (see ①).
  • Dev flag, the hint reused verbatim ("a multi-valued field holds a list") on a structured refusal: accepted deviation. The card's item asks for "the same hint as the multi-valued refusal"; the sentence still gives the correct fix. The PR body's "per the ruling" cites nothing: the card thread carries no ruling, only that item.
  • Dev flag, the verdict says a structured field without the type name: accepted; the field and object are named, and the type is one lookup away.
  • Dev flag, check:dual-build-cjs-loads not measured locally: answered by the head's check-runs, all green.
  • open_questions of report 7232219858 (where the ledger entry lands; the Clause-② arm): both answered by the seat's amendment 7232237546. The first answer named the filename with the 18. prefix, which is where M1 comes from. Report 7233729062 carries none.
  • The card's "Decide with the spec lane whether the same rule refuses it": no separate decision is on the card. This record is that judgment: the same rule should refuse it (④).
  • The card's "Measure first": done, 18 $record hits at 815e882, none a lookupFilters path to a structured field. Not re-run here.
  • "Read from code, the picker compares that object as one value" (changeset, ledger reason): the picker is not in this repository and I could not read it. What this tree does establish is the server half: an object or list is outside the accepted comparand set. The claim is worded as inference, which is what it is.
  • SQL push-down: not applicable. The change is an in-memory judgment over the object graph; no query, no id materialisation, no join.

④ Design judgment

The narrowing makes the spec's own refusal real; it does not take a declared capability away. On main, LookupFilterRecordReferenceSchema says a $record reference "stands for ONE value of the record being edited" and pairs only with the six scalar comparisons, and the spec's cross-field table already says a STRUCTURED_JSON_TYPES column is not one comparable value. No sentence of the published spec promises that a path to an address, a location, a JSON document, a repeater or a vector resolves to a comparand. The refusal sits beside the multi-valued one, uses the same two positions and the same predicate source the rest of the platform reads. Attempts to break it (a hop through a structured head, a structured head that is also multi-valued, an injected or out-of-stack leaf, a scalar field beside structured ones) all come out as the tests pin them.

M1 (must-fix) — the ledger entry is filed under protocol major 18, and it belongs to 19. The file is semantic/18.lookup-filter-record-path-structured-refused.ts, so gen:migration-registry places it in step18. On this head PROTOCOL_VERSION is 19.0.0 (moved by #37314 on 2026-11-26), the package is 19.0.0-next.2 in changesets pre mode, and the 18.x line is released through 18.6.0, so this refusal first ships in 19. composeMigrationChain(fromMajor, toMajor) keeps only the steps above fromMajor: an author on 18.6.0 who runs os migrate meta --from 18 gets step 19 alone and is never shown this entry, although that upgrade is exactly where the refusal starts. That is the silence ADR-0087 D3 exists to prevent, and the changeset's adr-0087: registered marker then claims a notice that upgrade does not deliver. The entries README names the file by protocol major, step19's own docstring says later retirements on the v19 line add their entries there, and 16 of the 19 semantic entries added since the protocol move are 19. files, including the sibling lookup refusal of #37910. The precedent was right to use 18: it shipped in 18.6.0 while 18 was the open line. Copying its prefix after the protocol moved is not. No gate catches this: check-adr-0087-registration reads the id, not the major. Fix: rename the file to 19.lookup-filter-record-path-structured-refused.ts; the id, the entry body and the changeset marker stay as they are. The seat's amendment 7232237546 names the 18. filename, so the file surface needs the same one-character correction.

S1 (should-fix) — the two texts that enumerate what this rule refuses at $record are now incomplete, and the predecessor updated both in its own PR. rule-explanations.ts (the os lint --explain object-field-ref-unknown text) says a resolving path "is refused too when it reads a list", naming only multi-valued fields. The spec describes in field.zod.ts (LookupFilterRecordReferenceSchema and lookupFilters[].value, which generate the reference page content/docs/references/data/field.mdx) say the same. An author refused for an address path who asks the rule to explain itself, or reads the reference, finds no such refusal. The claim's file surface forbade both files while other open PRs held them, which explains the gap and does not close it. Fix here, or name a follow-up card in the PR body; either way the texts should take the set from the same sentence the hand-written docs now use.

N2 (nit) — "holds an object" in the ledger reason, the changeset and the source comments is loose for three members: repeater and vector hold lists, and json is open. relationships.mdx already says it accurately ("a list or an object rather than one value").

Out of diff, for a follow-up card and not findings on this head: three other entries landed under 18. after the protocol move (two in #37366, one in #37513) and have the same exposure as M1; and a single file or image field is in neither refused set although the spec's cross-field table gives that family no comparison class either.

Tests: the new block derives its 14 head and leaf cases from the spec set itself, asserts the full message and hint, and carries a control and the hop-through case. Test Core is green on the head.

Implemented-by: claude/issue-34562-record-structural-lint
Reviewed-by: session_017xRBcSAaBEfQpU2yJexSJ8

VERDICT: FAIL

… say list or object

Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot changed the title fix(lint): refuse a lookupFilters $record path to a structured field fix(lint)!: refuse a lookupFilters $record path to a structured field Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 9a9f0e6 · 2026-11-28T05:44Z

Delta review of FAIL record 7233848869 (M1, S1, N1, N2) by the same isolated at-tier reviewer.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9a9f0e6421d9675916ebe74684004b1d3d8f6a00
Local-runs: none
Scope: packages/lint/src/validate-object-field-refs.ts, packages/spec/src/migrations/entries/semantic/19.lookup-filter-record-path-structured-refused.ts, packages/lint/src/validate-object-field-refs.test.ts + read, not reviewed: packages/spec/src/migrations/entries/README.md, packages/spec/src/migrations/registry.ts.template, packages/spec/src/migrations/chain.ts, packages/spec/src/kernel/protocol-version.ts, packages/spec/src/data/field-value.zod.ts, packages/spec/src/data/filter-cross-field-comparison-class.ts

Delta review of record 7233848869 (FAIL on c0deeb3). Inputs: the delta c0deeb35..9a9f0e64 (one commit, three files), the PR body and title as they stand, card #34562's two new comments (claim amendment 7233891050, os-dev-report 7234837890), follow-up card #38141, and the check-runs on this head. Everything the earlier record judged right and the delta does not touch stands as written there.

M1: closed
S1: closed

① Derived judgments

  • Migration ledger: the entry file is renamed to semantic/19.lookup-filter-record-path-structured-refused.ts, so the generator places it in step19, and no 18. copy remains in the tree at this head. With PROTOCOL_VERSION at 19.0.0, an author upgrading from the released 18.x line now meets the entry on the hop where the refusal starts. Right.
  • The entry's id, surface, replacement and acceptanceCriteria are byte-identical to the previous head. reason differs only by the "a list or an object rather than one value" wording and its line wrapping; I compared the two strings clause by clause and found no other change.
  • Accept set: unchanged by the delta. The two hunks in validate-object-field-refs.ts are comment text only; the predicate, the message and the hint are untouched, and the test file is not in the delta.
  • Public surface: unchanged by the delta.

② Semver level

Clause-②: no (narrowing) — unchanged in the PR body and the changeset, with Metadata-protocol: narrowed.

  • Levels unchanged: @objectstack/lint minor, @objectstack/spec patch. The delta publishes nothing that moves either.
  • N1 is taken: the changeset headline and the PR title both read fix(lint)!:.
  • Gate verdict: Check Changeset success on this head twice, run 140869171213 (04:52Z) and the re-run after the title and body edit, 140881198072 (05:45Z). Lint & Repo Gates, Test Core, Dogfood Regression Gate and Governed Surface Queue Guard are success; the head shows 62 success, 12 skipped, no failure and nothing pending.

③ Boundary flags

④ Design judgment

No must-fix, no should-fix.

The design judgment of the earlier record stands: the narrowing makes the spec's own refusal real and takes no declared capability away. The delta changes nothing about the refusal. It moves the ledger notice to the step whose upgrade it belongs to, which was the one contract defect on the previous head.

N2 is taken: the ledger comment and reason, the changeset and both source comments now say "a list or an object rather than one value", matching relationships.mdx.

Nothing new is introduced by the delta. I looked for a stale 18. reference to the new entry in the changeset, the PR body and the file's own comment, and found none; the comment's mention of the multi-valued entry by id is correct, since that entry keeps its own name.

Implemented-by: claude/issue-34562-record-structural-lint
Reviewed-by: session_017xRBcSAaBEfQpU2yJexSJ8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

L1: ACCEPT · head 9a9f0e6421d9675916ebe74684004b1d3d8f6a00 · 2026-11-28T05:49Z · card #34562

席位核对

  1. Shape — draft on main, mergeable_state clean, first line Fixes #34562 only, title fix(lint)!:, Clause-②: no (narrowing) · Metadata-protocol: narrowed on the body and the changeset, Skills-docs: line present. Fixes is right: the card's one item (the same rule refuses a $record path whose head or leaf is a structured field, the set taken from packages/spec, the hint reused, pinned beside the multi-valued block) is delivered.
  2. Premise measured — zero first-party $record paths to a structured field (count with a control, in the PR body); the 14 head/leaf cases red at the merge base, green at the head.
  3. Gates at this head — 62 success · 12 expected skip · 0 failed · 0 pending; Lint & Repo Gates and TypeScript Type Check success. NOT governed. Dogfood battery pinned to this head (os-dev-report on review follow-ups of PR #34489: lookupFilters { $record } to a structural field (json, repeater, location, address, vector) lints clean #34562): Test Files 490 passed | 3 skipped, no failures.
  4. L2 — CONTRACT_REVIEW_TIER (faces: narrowing + the ledger entry under packages/spec/src): FAIL 7233848869 on c0deeb35 (M1 the ledger entry filed under 18, a seat error in amendment 7232237546; S1; N1; N2), then delta PASS 7234904928 on this head — M1: closed, S1: closed (carrier lint: os lint --explain object-field-ref-unknown and the $record describes name only the multi-valued refusal, not the structured-field one #38141), N1 and N2 taken, nothing new.
  5. Read by the seat — the changeset and content/docs/data-modeling/relationships.mdx (the one sentence naming multi-valued and structured first fields or leaves): true to the diff. fields.mdx read by the dev and still holds. Accepted deviations: the hint sentence reused verbatim on a structured refusal (the card's "the same hint"); the verdict says "a structured field" without the type name (fixture line length).
  6. Out of scope — S1 (the os lint --explain text and the $record describes) → filed #38141; the other 18. ledger entries filed after the protocol move → filed #38142.

Landing — non-governed, ≤3000 lines, L2 PASS on this head, dogfood pinned: the seat lands it through the ordinary queue. #37936's N2 (Blocked-by: #38096) and #38141 unblock on merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Landing · 2026-11-28T05:50Z · head 9a9f0e64

probe reading
check-governed-merges.mjs --pr 38096 NOT governed · ≤ 3000 lines
landing-k.mjs --pr 38096 K = 13 < 15
L2 on this head delta PASS · record 7234904928 · CONTRACT_REVIEW_TIER
dogfood full battery pinned to this head, no failures (os-dev-report on #34562)

State: ready for review + auto-merge (L1 ACCEPT 7234918605).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 05:51
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Re-queue · 2026-11-28T08:41Z · head unchanged. The 08:02Z ejection (CI_FAILURE) carried no triage comment on this PR and no queue build on this PR's own branch: it is read as inherited from the group it was stacked in. This PR changes packages/lint and one ledger entry only, and its own checks are green (L2 delta PASS 7234904928). Re-queued once; an ejection whose signature names this diff stops it.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Re-queue · 2026-11-28T10:30Z · head 9a9f0e64 unchanged · second ejection, re-judged by signature before re-queuing.

Landing rule: knock-on removal with a receipt ⇒ re-queue once, as is.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 9a9f0e6 · 2026-11-28T11:03Z

The lane seat re-runs the CONTRACT_REVIEW_TIER review on this head through an isolated at-tier subagent. The queue guard refused record 7234904928: a mid-sentence grade word it cannot attribute (merge_group run 46135570271, Governed Surface Guard).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9a9f0e6421d9675916ebe74684004b1d3d8f6a00
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.lookup-filter-record-path-structured-refused.ts + packages/lint/src/validate-object-field-refs.ts, packages/lint/src/validate-object-field-refs.test.ts

Full record on this head, judged afresh. Inputs: card #34562 (body and all 9 comments), PR #38096 (body, title, 5 files, the net diff against main from merge base f72f335, every PR comment including records 7233848869 and 7234904928), and the check-runs on this head. Read to judge, not reviewed: packages/spec/src/data/field-value.zod.ts, field.zod.ts, filter-cross-field-comparison-class.ts, packages/spec/src/migrations/chain.ts, entries/README.md, entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts, packages/spec/src/kernel/protocol-version.ts, packages/lint/src/object-graph.ts, packages/lint/src/rule-explanations.ts, and follow-up cards #38141 and #38142.

M1: closed
The ledger entry is semantic/19.lookup-filter-record-path-structured-refused.ts at this head, and no 18. copy of it is in the tree.

S1: closed
Record 7233848869 gave this finding two routes: fix the two texts here, or name a follow-up card in the PR body. The PR body's Acceptance notes name #38141. I read the card: open, Blocked-by: #38096, it names rule-explanations.ts and the two describes in field.zod.ts, the sentence both should take, and the regenerated reference page. Both texts are outside this diff, and what they say today stays true once this lands; they are incomplete, not wrong.

① Derived judgments

  • Accept set, rule object-field-ref-unknown at lookupFilters[N].value.$record: a path that resolves, and whose first segment (a plain path) or leaf (behind one single-valued hop) is declared with a type in STRUCTURED_JSON_TYPES, moves from clean to an error. Right. The set is the spec's own export (field-value.zod.ts: json, composite, repeater, record, location, address, vector), imported and not re-listed. The check runs only where the family's resolution raised nothing (!hit) and only on the one slot that sets singleValued, so no path gains a second finding and no other slot changes.
  • All seven members kept, including composite and record, which the card's five did not name. Right: the spec classes the whole set as list-or-object with no comparison class (filter-cross-field-comparison-class.ts), and the card says to take the set from packages/spec.
  • json is the one member whose stored value may be a bare scalar, so for that stored shape an author loses a comparison that could have worked. The refusal by declared type is still right: the spec gives the type no comparison class whatever a row holds.
  • Multi-valued findings: unchanged. nonScalar tests isMultiValueField first and the message interpolates the noun where the literal stood, so a field that is both reads as multi-valued, as before.
  • A hop through a structured head (s_address.city): still the family's "not a relationship" miss, raised once. The goes through arm cannot be reached for a structured head behind !hit. Harmless.
  • Not judged, as before: a registry-injected column, a leaf on an object outside the stack, a field with no declared type.
  • Public surface: packages/lint adds, renames and removes no export; the return type that gained what is closure-local. packages/spec gains one ledger entry and no schema, key or describe change.
  • Migration ledger: one new semantic entry, id lookup-filter-record-path-structured-refused, filed under step 19. Right (see ④).

② Semver level

Clause-②: no (narrowing) — line-initial in the PR body and in the changeset, with Metadata-protocol: narrowed beside it. The two agree with each other and with the diff.

  • @objectstack/lint minor: matches a narrowed accept set on the package whose finding changes, in changesets pre mode. Same level as the predecessor feat(lint)!: refuse a lookupFilters { $record } path through or to a multi-valued field #34489.
  • @objectstack/spec patch: matches one ledger entry and nothing else published from spec.
  • Title and changeset headline both read fix(lint)!:.
  • Gate readings on this head: 63 check-runs success, 12 skipped, none failed, none pending. Check Changeset is among the successes.

③ Boundary flags

④ Design judgment

No must-fix, no should-fix.

The narrowing makes the spec's own refusal real and takes no declared capability away. On main the published LookupFilterRecordReferenceSchema says a $record reference stands for ONE value of the record being edited and pairs only with the six scalar comparisons, and the spec's cross-field table already says a STRUCTURED_JSON_TYPES column is not one comparable value. No sentence of the published spec promises that a path to an address, a location, a JSON document, a repeater or a vector resolves to a comparand.

19.lookup-filter-record-path-structured-refused.ts, against the code it cites:

  • Step: PROTOCOL_VERSION is 19.0.0 and @objectstack/spec is 19.0.0-next.1 in pre mode, so this refusal first ships in 19. composeMigrationChain keeps the steps above fromMajor, so an author upgrading from 18 meets this entry on the hop where the refusal starts. The file name follows the README's protocol major.id.ts rule.
  • surface: lookup, master_detail or user field, the first segment or the leaf behind a single-valued hop, the seven types. Each clause matches PICKER_FIELD_TYPES, the slot's maxHops: 1 and multiValuedSegment. "First segment" also covers a hop through a structured head, which is refused under the family's other message; the reason says so.
  • replacement and acceptanceCriteria: the same shape as the multi-valued sibling, with "scalar" added where it is needed. The fix they prescribe is the one the lint hint gives.
  • reason: "the path check judged existence and multi-valuedness only" is what the merge-base source did. The unjudged cases it lists are the ones the code leaves unjudged.

validate-object-field-refs.ts, sentence by sentence against that contract: the jsdoc at the rule's header, the singleValued slot comment and the multiValuedSegment comment each say head or leaf, the spec set, the same hint, and the unjudged cases, and the code does each. I tried a structured head with a hop, a structured field that is also multiple: true, an injected leaf, an out-of-stack hop target and scalar fields beside structured ones. Each comes out as the tests pin it.

validate-object-field-refs.test.ts: the 14 head and leaf cases are derived from the spec set itself, so a member added to the set later is pinned without an edit. Each asserts the rule id, the whole message and the whole hint. A control and the hop-through case sit beside them.

Implemented-by: claude/issue-34562-record-structural-lint
Reviewed-by: session_017xRBcSAaBEfQpU2yJexSJ8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Re-queue · 2026-11-28T11:07Z · head 9a9f0e64 unchanged · the fourth queue entry, after the root cause was found and fixed.

Correction to my receipt 7237945741 (10:30Z). That comment called the 09:20Z removal a knock-on from #38164's flaky batch. The real block, read off the 10:54Z removal, is this PR's own merge_group run 46135570271: Governed Surface Guard, exit 10. It held the PR because of the review record, not the diff:

  • The PR declares Clause-②: no (narrowing) / Metadata-protocol: narrowed. So the guard asks for a contract-review record that reads a clean PASS.
  • The delta record 7234904928 said "the earlier should-fix" in the middle of a sentence. The guard's reader cannot attribute a grade word there, so it refused (pm: a same-head PASS record that still lists an open should-fix clears the queue guard #33604). The CI success on that run is a separate workflow; the guard run is the one that held it.

Fix: a fresh full CONTRACT_REVIEW_TIER record on this same head, comment 7238340554 (fable, isolated, tier evidence attached). It is PASS. It closes the earlier findings by id at a line's lead (M1: closed, S1: closed, S1 through its named carrier #38141, a route record 7233848869 itself offered). Its only grade-word line is No must-fix, no should-fix.. The reviewer ran the guard's own reader functions on the exact text: contractReviewRecordReading gave findings.open: [] and findings.unreadable: []; recordPassVerdict gave state: 'stands', verdict: 'PASS'.

The diff and its checks are unchanged: 63 success, 12 skipped, 0 failed on this head. If the guard refuses again, it gets diagnosed, not re-queued.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

维护者速读

  • 用户能看到什么变化:在查找字段的过滤条件里,引用当前记录的某个「结构化字段」(地址、位置、JSON、子表等)做比较,以前检查不报错、运行时却比不出结果;现在 lint 直接报错,告诉作者改成引用其中一个普通字段。
  • 为什么做:这种写法本来就比不出值,平台自己的规范也说它不是一个可比较的值,以前是静默失效。
  • 出错会怎样:最坏是某个作者写过这种(本就无效的)条件,升级后 lint 报错,按提示改一行即可;实测我们自己的代码和示例里一处都没有。
  • 要你做什么:这是一处「收窄」(以前能通过检查的写法现在会被拒),按规则要你批准才能合并:请在 PR 上点 Approve,之后由席位落地。

席位意见:建议批准。合同审查(CONTRACT_REVIEW_TIER)在当前 head 上为 PASS(记录 7238340554),无未关闭的 must-fix / should-fix;变更只在 lint 规则与一条迁移账本条目。

席位核对 · ACCEPT · head 9a9f0e6421d9675916ebe74684004b1d3d8f6a00 · 2026-11-28T11:27Z · card #34562

  1. Shape: open on main, mergeable_state clean, first line Fixes #34562 only, title fix(lint)!:. Clause-②: no (narrowing) · Metadata-protocol: narrowed on the body and the changeset, plus a Skills-docs: line. Fixes is right: the card's one item is delivered. That item: the rule refuses a $record path whose head or leaf is a STRUCTURED_JSON_TYPES field, the set imported from packages/spec, with the same hint.
  2. Premise measured: zero first-party $record paths to a structured field across the four trees (18 $record hits, none of this shape). The 14 head/leaf cases are red at the merge base and green at the head.
  3. Gates at this head: 63 success · 12 expected skip · 0 failed · 0 pending. Dogfood battery pinned to this head: Test Files 490 passed | 3 skipped.
  4. Accepted deviations: the hint sentence is reused verbatim on a structured refusal (the card asks for "the same hint"; N3). The verdict says "a structured field" without the type name. The PR body says "per the ruling" where the card item is meant (N4, prose).
  5. Out of scope and Skills-docs: S1 (the os lint --explain text and the $record describes) is carried by lint: os lint --explain object-field-ref-unknown and the $record describes name only the multi-valued refusal, not the structured-field one #38141 (Blocked-by: #38096). The other 18. ledger entries filed after the protocol move went to spec migrations: three ADR-0087 semantic entries landed under protocol major 18 after PROTOCOL_VERSION moved to 19, so os migrate meta --from 18 never shows them #38142.
  6. Landing: this declares a narrowing, so it is Tier H by the queue guard's narrowed leg. My earlier ordinary-queue landing was wrong. Merge-queue run 46138451005 (Governed Surface Guard) refused it for "no authorized APPROVED review (authorized: os-zhuang)". It is now handed to the approver with pm:awaiting-merge. After an authorized approval, the seat lands it (ready, auto-merge).

L2: full record on this head, 7238340554, PASS (M1: closed, S1: closed, nits N3/N4), which the guard's reader reads clean.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Request: approval · PR #38096 declares a narrowing (Clause-②: no (narrowing)), so the queue guard lands it only with an authorized approval. Seat ACCEPT and the maintainer brief are on the thread; CONTRACT_REVIEW_TIER PASS on head 9a9f0e64 (7238340554). Please approve; the seat lands it after.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46138450933 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/expression-conformance.test.ts > ADR-0058 D7 — expression surface conformance ledger > is a sound conformance ledger + ratchet (ADR-0060 checkLedger)
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: UNCLASSIFIED surface — add a ledger row (ADR-0060): data/object.zod.ts:ObjectSchemaBase.uiReadonlyWhen: expected [ Array(1) ] to deeply equal []
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 22 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 28, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as draft November 28, 2026 11:57
@os-zhuang
os-zhuang marked this pull request as ready for review November 28, 2026 12:08
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit c2a3e61 Nov 28, 2026
81 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-34562-record-structural-lint branch November 28, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review follow-ups of PR #34489: lookupFilters { $record } to a structural field (json, repeater, location, address, vector) lints clean

3 participants