Repository navigation
fix(lint): kanban group-field hint offers a grid grouping only where the engine accepts it - #38635
Conversation
…the engine accepts it Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5d4e98f629cd1ef7618ddc5664c74afb8e7d2ad6 && git checkout 5d4e98f629cd1ef7618ddc5664c74afb8e7d2ad6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin cb99e2d627c48ab7703d97ba800409624bc8e763 e0e643722ad8814c2fabce64ae1046be96cbd90b && git checkout -B drift-repro cb99e2d627c48ab7703d97ba800409624bc8e763 && git merge --no-ff e0e643722ad8814c2fabce64ae1046be96cbd90b
node scripts/docs-audit/affected-docs.mjs --json cb99e2d627c48ab7703d97ba800409624bc8e763 |
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Final green head · 2026-11-29T17:37Z · zone o3-B · |
|
repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv 席位核对ACCEPT @ Read at head:
Nits (non-blocking):
Landing note: this is a partial delivery. After merge, release the card in one stroke ( |
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Landing · 2026-11-29T17:42Z · zone o3-B · head
State: ready for review + auto-merge in this stroke. Body says |
… group by (objectstack-ai#38651) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JeHmqv6CKCkW8ewrPBLekk)_ Refs objectstack-ai#38433 (item 3) Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: follow-up objectstack-ai#38655 ## 维护者速读 - 作者在命令行校验或在设计器保存表格列表视图时,若按多值字段、JSON 字段或公式字段分组,会被直接拒绝并给出改法;看板、日历等其它视图不受影响,运行中的用户无感。 - 属于「发布时拦下保存成功却用不了的元数据」这一组检查,补上看板分组提示修复之后剩下的一项,替作者在发布前发现一打开就报错的列表。 - 碰到的是已经这样分组的表格视图作者,下次保存会被拒(这样的视图本来一打开就报错,平台自带的视图无一受影响);撤回本合并即可恢复原状。 - 无 ## What changes Item 3 of the card. Items 1, 2 and 4 landed in PR objectstack-ai#38635. - New lint finding `list-view-group-field-ungroupable` (`error`) in `validateListViewFieldRefs`. It fires when a grid list view's `grouping.fields[].field` (a view whose `type` is `grid`, or absent, since the schema defaults it to `grid`) names a multi-valued field (`multiselect`, `checkboxes`, `tags`, or a `multiple` select or reference), a structured-JSON field (`json`, `address`, `composite`, …) or a `formula` field. The grouping compiles to the group header query (`compileListViewGroupQuery`), and `engine.aggregate` refuses a `groupBy` over each of these with `400 INVALID_FIELD`. Until now such a view saved and published, then opened on that error. - Other list-view kinds are not judged: `kanban`, `gallery`, `calendar`, `timeline`, `gantt`, `map`, `chart`, `tree`, `timesheet`. The list view asks the group header query only when it renders as a grid. Kanban was measured: it reads `grouping.fields[0].field` as its swimlane fallback, asks that read only when the board is windowed, and on a refusal drops the lanes and keeps drawing its cards. It does not break, so it stays quiet here. - The finding runs wherever this rule function already runs: `os validate` / `lint` / `compile` / `build`, and the runtime save door on `view` and `object` writes. `runtimeTypes` is unchanged. - The refused set comes from one helper, `groupByRefusedClass`. It asks the spec predicates the engine's two doors ask: - `STRUCTURED_JSON_TYPES` and `isMultiValueField`, asked by `assertGroupByNamesNoJsonStoredField` (`packages/objectql/src/group-by-structured-json-door.ts:130-132`, called at `engine-delete-and-aggregate.ts:1086`); - `isVirtualSearchField`, asked by `assertGroupByTargetsAreStored` (`aggregate-query-shape-door.ts:249`, called at `:1120`). - The kanban hint from PR objectstack-ai#38635 now calls the same helper, so there is no second type list. - The hint prescribes a fix the engine accepts: show the field as a grid column, or group by a stored single-valued field. - The rule refuses exactly the three storage classes the engine refuses. Not judged by this finding: an unknown name (`list-view-field-unknown`) and a dotted name. The engine refuses a dotted name on another ground (`aggregate-query-shape-door.ts:231`), which this verdict does not report (objectstack-ai#38654). - Also in this PR: - an `os explain` entry, with its barrel export `LIST_VIEW_GROUP_FIELD_UNGROUPABLE`; - the `validating-metadata.mdx` row; - the ADR-0087 semantic entry `publish-refuses-list-view-grouping-the-engine-does-not-group-by` (`@objectstack/spec` patch); - a minor changeset for `@objectstack/lint` with a BREAKING banner and FROM → TO. First-party impact, measured: 7 first-party list views declare a grouping, in `packages/platform-objects` and `plugin-approvals`. Every one groups by a stored single-valued text, select or lookup field, and running the new rule over them gives 0 findings. `examples/**` and `packages/apps/**` declare no grouping. Contract face: the lint rule's accept set narrows. This PR stays draft for the CONTRACT_REVIEW_TIER review the seat routes. ## Read first 1. `packages/lint/src/validate-list-view-field-refs.ts`: `groupByRefusedClass` and `checkGroupField`. `groupByRefusedClass` is the refusal set (the engine's three storage classes); `groupingReachesAggregate` is the kind gate (grid or absent `type`). 2. `packages/spec/src/migrations/entries/semantic/19.publish-refuses-list-view-grouping-the-engine-does-not-group-by.ts`: the upgrade-guide text. 3. `.changeset/38433-list-view-group-field-ungroupable.md`: the BREAKING banner and FROM → TO. ## Two-minute check `pnpm --filter @objectstack/lint exec vitest run src/validate-list-view-field-refs.group-field-38433.test.ts`: 21 passed. ## Tests New file `packages/lint/src/validate-list-view-field-refs.group-field-38433.test.ts`, 21 cases: - one refused case per engine-refused class: `multiselect`, a `multiple` lookup, `json` and `formula`. Each asserts the rule id, `severity: error`, `where` and `path`, and first checks the engine predicate for that declaration; - controls that stay quiet: a single-valued select, a text field and a single-valued lookup; - a dotted case (`account.tags`, `account.name`) that stays quiet; - an unknown name and a multi-level grouping; - `validate` and `build` fail; - a runtime `view` save-door case through `runRuntimeAuthoringRules`: refused on `json`, admitted on `status`; - the `os explain` entry; - an untyped list view: `ListViewSchema` parses an absent `type` to `grid`, and the rule judges it; - quiet controls for `kanban`, `gallery`, `calendar`, `timeline`, `gantt` and `map` list views grouped by every refused class. <details><summary>Readings</summary> - Head 63018a1 (origin/main f5da514 is its merge base). - New file plus the sibling suites `validate-list-view-field-refs.test.ts`, `validate-list-view-kanban-lanes.test.ts` and `rule-explanations.test.ts`: Test Files 4 passed (4), Tests 274 passed (274). - `packages/spec/src/migrations`: Test Files 5 passed, Tests 209 passed. - `pnpm --filter @objectstack/lint typecheck`: `VERDICT command-exit 0`. - Whole `@objectstack/lint` suite, at 410314f, before the merge and before the kind gate: Test Files 247 passed (247), Tests 9977 passed, 5 skipped. Not re-run at this head. - Ablation 1, `scripts/ablation-replace.mjs --delete` of the kind gate (`if (!groupingReachesAggregate(listView)) return;`): anchor 1 to 0, blob ece52e6 to c7376add4dc5. 6 failed: the six kind controls. 15 passed. After the restore the blob equals HEAD and `git diff HEAD` is empty. - Ablation 2, `--delete` of the `checkGroupField` call: anchor 1 to 0, blob ece52e6 to 12f0dde9d8bf. 9 failed: the four refused classes, the untyped view, multi-level, validate, build and the save door. 12 passed. Restored the same way; the tree is clean. </details> ## Verification <details><summary>Gates on 63018a1</summary> - `node scripts/check-changeset-no-major.mjs --base origin/main --event EVENT` (EVENT built from a live read of this PR): exit 0. - `node scripts/check-adr-0087-registration.mjs --base origin/main`, same event: exit 0. `registered publish-refuses-list-view-grouping-the-engine-does-not-group-by`, `1 migration entry added, each at or above PROTOCOL_MAJOR 19`. - After a spec build under the lock: `check:spec-changes` exit 0 (`aggregate 118 converted / 691 migrated`), `check:upgrade-guide` exit 0, `check:docs` exit 0. - `check:doc-authoring`, `check:issue-citations`, `check:nul-bytes`: exit 0. - `node scripts/pm/overlap-check.mjs --branch=HEAD`: `VERDICT clean exit 0`; the push was gated on it. - The rest of the derived family set is left to CI. At db3d5ec, before the merge, 64 of 70 derived families exited 0 locally; the other 6 were NOT MEASURED (a prerequisite not met, or my per-gate timeout). - Full dogfood battery: run at b7e76b2 (Test Files 495 passed, 3 skipped; Tests 4187 passed, 68 skipped). NOT MEASURED at 63018a1, reason: not re-run for this round. </details> ## Acceptance notes - A dotted grouping field (`account.name`, `account.tags`) still passes `os validate`. `grouping.fields` has no dotted-axis row in this rule, while `engine.aggregate` refuses every undeclared dotted `groupBy` name with `400 INVALID_FIELD`. It is filed as objectstack-ai#38654 and is not widened here. - The Grouping section of `skills/objectstack-ui/rules/list-views.md` should name this refusal. That is follow-up objectstack-ai#38655. - AGENTS.md puts a new pin for a component with a shared harness file into that file (ruling record 6583487846). The dispatch ordered a new file named for the card, which this PR follows. The conflict is flagged here. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Refs #38433 (items 1, 2)
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
list-view-kanban-group-field-uncategoricalnow offers the grid-grouping remedy only on the branch where it holds.checkKanbanGroupField,packages/lint/src/validate-list-view-field-refs.ts): the tail is keyed on the engine's own refusal set, read from the same spec predicates the twoengine.aggregatedoors use:isMultiValueField, the multi branch) and structured-JSON (STRUCTURED_JSON_TYPES) are refused byassertGroupByNamesNoJsonStoredField;formula(isVirtualSearchField) is refused byassertGroupByTargetsAreStored;400 INVALID_FIELD. A list viewgroupingcompiles to that group-header query (compileListViewGroupQuery), which the grid sends.or show "FIELD" as a grid column (a list cannot be grouped by REASON); every other warned field (text, number, date and the rest of the stored single-valued scalars) keepsor show "FIELD" as a grid grouping.rule-explanations.ts, this rule's entry only): the fix paragraph now says the same, branch by branch: stored single-valued field gives grid grouping; multi-valued, JSON-stored orformulagives grid column only, with the reason.formulagroup field already warned, on the single-valued branch (it is not inKANBAN_CATEGORICAL_TYPES), and got the grid-grouping tail. No finding, severity or accept set changes.select, boolean and lookup are the heads of the three families the rule accepts (select/radio,BOOLEAN_VALUE_TYPES,REFERENCE_VALUE_TYPES). Naming each member would hand-copyKANBAN_CATEGORICAL_TYPESinto prose that drifts from it, and would lengthen a hint held to 200 characters.Read first, by risk:
packages/lint/src/validate-list-view-field-refs.ts, theungroupable/gridRemedyhunk incheckKanbanGroupField: this is where the set is keyed.packages/lint/src/validate-list-view-kanban-lanes.test.ts, the new per-fieldit.each.Two-minute check:
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-list-view-kanban-lanes.test.ts. Expect 34 passed. Thetags,watchers,meta,addressandscorerows assert a grid column;amount,due_dateandsubjectassert a grid grouping.Tests
At head
e0e643722a:@objectstack/lint: full suite and typecheck
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2: Test Files 246 passed (246), Tests 9962 passed, 5 skipped (9967).pnpm --filter @objectstack/lint typecheck: exit 0; check:test-typecheck OK.src/validate-list-view-kanban-lanes.test.ts: 34 passed.Ablation
Forced
gridRemedyto always take the grid-grouping arm, on disk, then ran the target file: 5 failed / 29 passed. The failures were exactly the five ungroupable rows (tags,watchers,meta,address,score). Restored withgit checkout HEAD --, tree clean.Acceptance notes
grouping.fields[].fieldnaming a multi-value, JSON-stored or non-stored field) is not in this PR. It is a narrowing and stays on the card.engine.aggregatealso refuses agroupByon a credential orinternal-flagged column (rejectCredentialEvaluation,rejectInternalFieldEvaluation). The hint is not keyed on those, because the refusal comes from a flag and not from the storage class. A kanban board grouped by a password field is not a realistic producer. Noted only.Verification
Derived local gates (dispatch-gates --commands, 70 families)
dispatch-gates --ran: 70 derived, 67 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite), 0 unrun.check-plugin-teardown-shape --self-test(shallow clone cannot reach its pinned fixture commit),check:dual-build-cjs-loadsandcheck:lean-entry-closure(need dist of packages outside this diff's closure). Left to CI.check:docs-transcript-driftwas re-run after building@objectstack/lint: exit 0.check:type-check-debtandcheck:query-options-erasure: exit 0.overlap-check --branch=HEAD: clean against origin/main and fix(lint): the record-write-discarded hint prescribes a write the sandbox installs; app-dependencies lists the closure-judged bindings #38628, fix(lint)!: judge a tree field's dependsOn filter key like a lookup's #38605, fix(lint)!: the publish gate refuses a subflow or map step that calls a flow the deployment does not hold #38594, feat(spec)!: actions that act on many records are placed atselection; a list view'sbulkActionsis retired #38550.Generated by Claude Code