Repository navigation
docs(skills): teach the lookupFilters { $record } reference and orEmpty - #34528
Conversation
objectstack-data rules/field-types.md, and the data-modeling docs pages relationships.mdx and fields.mdx, teach a lookup filter that reads the record being edited: the reference shape (a field, or one lookup hop), the six operators it and orEmpty pair with, the entry dropped on an empty value, and why a $record field is not also listed in dependsOn. field-types.md sat at zero token headroom: five same-file restatements are cut first (179 bytes), and the ratchet row moves by the measured remainder, 3349 -> 3553. Claude-Session: https://claude.ai/code/session_01WGufzhek783Lg4DsyfFDxo Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#3 · os-support-ai · session_01WGufzgtCwPzNYSczvxDEpw Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (seat session runs the default tier, 2026-11-17T00:11Z) · head 09f66fe The diff touches |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 09f66fe · 2026-11-17T00:12Z |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract reviewServed-tier: Inputs: card #34201 (body and its five comments, claim 6922776400 and dev report 6933361559 included), the PR body, handoff 6933409231, the net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
N1 (nit) — N2 (nit) — the reader also treats an empty list as an empty value ( No must-fix. No open should-fix. Implemented-by: VERDICT: PASS |
|
domain:skills#3 · os-support-ai · session_01WGufzgtCwPzNYSczvxDEpw 维护者速读
席位核对Verdict: ACCEPT · head
|
run_action and resume_run take no confirm
#34558
Requested by Yibo Wang · project thread
Fixes #34201
Clause-②: no
Metadata-protocol: none
Skills-docs: updated here
维护者速读
objectstack-data技能的rules/field-types.md和两页数据建模文档(relationships.mdx、fields.mdx)开始教 lookup 筛选里的{ $record }引用和orEmpty:引用怎么写、引用值为空时这条筛选被略过、orEmpty及它能搭配的六个运算符、它和dependsOn的区别。skills/objectstack-data/rules/field-types.md第 210–234 行(新教学)和第 42、132、254、264 行(删掉的重复);scripts/check-skills-token-ratchet.mjs里field-types.md那一行上限及其注释;content/docs/data-modeling/relationships.mdx第 44–83 行。node scripts/check-skills-token-ratchet.mjs | grep field-types,预期看到3553 / 3553 (+0),末行 ✓。skills/**,属于需要你亲手合并的受管面)。Liveness readings (the premise, measured at
9e6fee19)The card says to teach only once the reader lands. Both shapes are read today, so both are taught:
packages/spec/liveness/field.json, rowlookupFilters:status: live,verifiedAt: 2026-11-16. Its note names the readers:ui/packages/fields/src/widgets/lookupRecordReference.ts#resolveLookupFiltersputs the value of the record being edited in place of each{ $record }reference, only on a field a record form stamped throughwithRecordBeingEdited, and leaves out an entry whose value is empty or cannot be read;ui/packages/fields/src/widgets/RecordPickerDialog.tsx#lookupFiltersToRecordsendsorEmpty: trueas an$orwith a$nullmatch on the same column.9e6fee19and carry those functions (git lognames the landing commit2c296cf2, PR feat(fields): lookup picker resolves { $record } lookupFilters values and sends orEmpty #34253).RecordPickerDialog.tsxline 267 builds{ $or: [{ [f.field]: condition }, { [f.field]: { $null: true } }] }.[PLANNED — not enforced]markers:grep -c PLANNED packages/spec/src/data/field.zod.tsanswers 0; thevalue,orEmptyandlookupFiltersdescribes say what the picker does. No spec marker is left to flip.grep -c -E '\$record|orEmpty'answers 0 in each of the three target files (control: 36 hits inpackages/spec/src/data/field.zod.ts).LOOKUP_FILTER_SCALAR_COMPARISONSinfield.zod.ts:eq,ne,gt,lt,gte,lte.os validaterefuses a path that names no field) isobject-field-ref-unknowninpackages/lint/src/validate-object-field-refs.ts, severityerror.What changes
skills/objectstack-data/rules/field-types.md(§ Lookup). The section's one example becomes a quote'sprice_booklookup with a literal entry, a{ $record: 'quote_date' }entry and a one-hop{ $record: 'account.market' }entry, both withorEmpty: true. One paragraph under it carries the four points: the reference is the wholevalueand pairs, likeorEmpty, only with the six operators; only a record form resolves it and every other picker host leaves the entry out; an empty or unreadable value drops the entry;orEmpty: truealso matches a null column; a$recordfield is not also listed independsOn, which would add an equality filter. It ends with the limit the spec states: the picker only narrows the choice.content/docs/data-modeling/relationships.mdxgains#### Filter by the record being editedunder Filtered Lookups: the shape, one example (the same price-book case, with both date bounds), and five short bullets (the reference, where it resolves, an empty value,orEmpty,dependsOnor$record).content/docs/data-modeling/fields.mdx: one more lookup in the relationship example, thelookupFiltersrow of the property table namesorEmptyand the reference, adependsOnrow is added, and a short#### Lookup filters that read the record being editedsection states the four points and links to the relationships page.scripts/check-skills-token-ratchet.mjs: thefield-types.mdrow moves 3349 → 3553, with its row comment (next section).The ceiling raise: cuts first, then the measured remainder
field-types.mdsat at zero headroom (3349 / 3349), so any teaching reds the ratchet. The standing ruling, verbatim and untranslated: 「A:先削重复,余额按实测提高」 (maintainer, 2026-10-27), the gate-recognised path per ruling record 6513306068 (letter B). The skills seat accepted the row edit as an in-scope widening for this card.Five same-file restatements are cut, 179 bytes. Each fact is still carried by the sentence named:
secretrow: "The recommended type for credentials"passwordrow, line 41: "Prefersecretfor credentials"autonumberrow: "({0000} counter + optional date / {field} tokens, resets per scope)", now "(→ Autonumber)"autonumberrow: the secondformatexample,"AD{YYYYMMDD}{0000}"AD{YYYYMMDD}{0000}→AD202606170001{0000}row: "(minimum width)"The teaching adds 994 bytes; net +815 bytes.
wc -c= 14210 →ceil(14210 / 4)= 3553 tokens. The row is pinned at the measurement, zero headroom, +204, and no other row moves.Published-skill size readings
rules/field-types.md, linesrules/field-types.md, bytesrules/field-types.md, tokens (the ratchet's count)skills/*/SKILL.md, linesWhy
The
{ $record }reference andorEmptywere declared ahead of their reader and marked PLANNED; the docs half waited on the picker. The picker landed in PR #34253, so an author can now filter a lookup's candidates by the record being edited, and nothing an AI builder reads said so.Tests
None owed: prose in two docs pages and one published skill file, and one data row in a gate script's map. No tested behaviour changes, so no ablation. The gate script's own suite is its
--self-test(104 cases pass); no*.test.*file names it (git grep -l check-skills-token-ratchet -- '*.test.ts' '*.test.mjs'is empty).Acceptance notes
skills/objectstack-data/evals/objects-fields-relationships.jsonhas 20 cases and none covers lookup filters (grep -c lookupFiltersanswers 0), so by the order none is added here.scripts/check-skills-token-ratchet.mjsis one more file, accepted by the seat before the push; the changeset is the fifth path.content/docs/data-modeling/field-types.mdxalso describeslookupFiltersand dependent lookups and does not mention{ $record }. It is outside the card's three files. carrier: none.@objectstack/skillspatch (.changeset/34201-skills-lookup-filter-record-reference.md), both declaration lines in it.Verification
Head
09f66fe6onorigin/main9e6fee19. Main has since moved toec6b5fd3; none of the four edited files changed there (git diff --stat 9e6fee19 ec6b5fd3over them is empty), so the branch was not re-merged.Derived set:
node scripts/pm/dispatch-gates.mjs --commandson the committed change set → 88 commands. Each ran in this worktree at09f66fe6, exit codes captured before any pipe;--ran: "88 derived famil(ies) accounted for — 87 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".node scripts/check-skills-token-ratchet.mjs→ exit 0: "57 authored bundle file(s) within their ceilings";field-types.md3553 / 3553.node scripts/check-skills-token-ratchet.mjs --self-test→ exit 0, 104 cases pass.pnpm --filter @objectstack/spec run check:skill-examples→ exit 0, 347 prose examples type-check (after the@objectstack/client-react...and@objectstack/lint...closure build under the verify lock, VERDICT command-exit 0, 310 s).pnpm check:doc-anchors→ exit 0, 1042 internal fragment links resolve (the newrelationships#filter-by-the-record-being-editedlink among them).pnpm check:doc-authoring,pnpm check:skill-links,pnpm check:skill-identifier-liveness,pnpm check:ratchet-remedy-authority,pnpm check:pm-governed-merges,node scripts/check-empty-changeset.mjs --base origin/main,node scripts/check-changeset-no-major.mjs --base origin/main→ exit 0 each.pnpm check:dual-build-cjs-loads, exit 3, "PREREQUISITE NOT MET — this gate reads built output, and some package has no dist/". It needs a fullpnpm build, which this diff does not otherwise owe (no package source moved); CI's build lanes carry it.Not run locally, CI's own:
pnpm lint(repo-wide), the type-check lanes,Test Core,Build Core. No package test is owed: no package source moved.node scripts/pm/check-governed-merges.mjs --branch HEAD: governed, 1 of 5 paths (skills/**), landing tier H; 127 changed lines.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (no formatter ran; the repo-widepnpm lintscan is CI's own run, so it is not claimed here: read theLint & Repo Gatescheck-run)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code