Repository navigation
Commit d578952
fix(lint)!: publish-time checks for views, dashboards and the app shell that save and do not work (#38107)
Part of #35143
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up owed — skills/objectstack-ui/rules/list-views.md,
skills/objectstack-ui/SKILL.md (#38153)
## 维护者速读
-
作者在命令行校验或在设计器保存应用时,会多看到六条提示:看板按非选项字段分组、空白仪表盘、列表筛选用了公式字段、应用没有导航、对象没有入口、打开的对象没有设计过列表;运行中的用户无感。
- 属于「发布时拦下保存成功却用不了的元数据」这一组检查的第二批,替作者在发布前发现页面打不开或显示空白的问题。
- 只有列表筛选用公式字段一条会拒绝保存(这样的视图本来一打开就报错);其余五条都只是提醒,撤回本合并即可恢复原状。
- 无
## What changes
The "Views, dashboards, app shell" lines of #35143, each re-verified on
`origin/main` (27ee984) first: a probe of all six shapes produced no
finding on `os validate` / `build` / `lint` nor at the runtime `view` /
`dashboard` / `app` doors. Two lines extend an existing rule; the app
shell is one new module.
| Line | Rule id | Where | Severity | Doors |
|---|---|---|---|---|
| V1a board grouped by a field with no lanes |
`list-view-kanban-group-field-uncategorical` | extends
`validateListViewFieldRefs` | warning | CLI + runtime (view, object) |
| V1b dashboard with no widgets | `dashboard-without-widgets` | extends
`validateWidgetBindings` | warning | CLI + runtime (dashboard) |
| V2 list filter on a formula field | `list-view-filter-field-virtual` |
extends `validateListViewFieldRefs` (own filter and `userFilters.tabs`
filters) | error | CLI + runtime (view, object) |
| V3 app with no navigation entry | `app-navigation-empty` | new
`validateAppNavigationPresent` | warning | CLI + runtime (app) |
| V3 object no app opens | `object-unreachable-from-navigation` | new
`validateObjectShellReach` | warning | CLI only (needs the full
snapshot) |
| V3 navigated object with no list view | `object-without-view` | new
`validateObjectShellReach` | warning | CLI only |
Severity reasoning (engine read, consistent across the publish door and
the CLI):
- **V2 is an error everywhere**: objectql's
`assertFilterIsMaterializable` refuses a filter on a virtual field
(`isVirtualSearchField`) with `400 INVALID_FIELD`, so the saved view
opens on that error. This is the narrowing.
- **V1a is a warning**: the kanban renderer falls back to lanes from
loaded records, so a text-grouped board still draws, only with lanes
nobody designed; reference and boolean fields are categorical (reference
lanes are supported), multi-value fields are flagged because they
stringify into combined lanes.
- **V1b is a warning at every door** (seat ruling M1 option B): the
shape breaks no request (the dashboard opens on its header), and the
platform's own create steps write it and fill it afterwards: Studio, the
spec's dashboard create seed, and `os generate dashboard`. Both doors
see the same dashboard, so the severity is the same.
- **V3 is a warning**: each shape is a legitimate step of building an
app; nothing breaks a request. `app-navigation-empty` counts navigation
contributed into the app (`navigationContributions`); a contribution
from a package the stack cannot see is why it is not an error.
`object-unreachable-from-navigation` says only that no navigation entry
opens the object's list. Not judged: a stack with no app and no
contributions; an object with a `master_detail` field or named in
another object's `relatedLists`; an object a page names when a `type:
'page'` entry opens that page; an object with `enable.apiEnabled:
false`. `object-without-view` reads `ObjectSchema.listViews` and bound
`views[]` items, and is judged only where an entry opens a list (no
`recordId`).
Also: six `os explain` entries, an ADR-0087 semantic migration notice
(`19.publish-refuses-views-and-dashboards-that-save-and-do-not-work`),
the docs rule-family table rows, and the "author-time rules (N)" counts
(main 88 → 90).
## Why
Each of these saves cleanly and then shows the user less than was built:
a page that opens on an error, a blank dashboard, an app that opens on
the "no access" empty state, an object nobody can reach, or an "All
records" list nobody designed.
## Tests
Readings at head `2399eab8` unless marked; the commits after `d95f7a4e`
touch only three `packages/cli/test` fixtures.
<details><summary>Lint package</summary>
- `pnpm --filter @objectstack/lint test` (at 1d79fae, lint source
unchanged since): Test Files 246 passed (246), Tests 9921 passed.
`typecheck` OK.
- Suites: `validate-app-shell-reach.test.ts` (new),
`validate-list-view-field-refs.test.ts`,
`validate-list-view-kanban-lanes.test.ts`,
`validate-widget-bindings.test.ts`,
`validate-security-posture.runtime-surface.test.ts`. Every rule pinned
lit and dark, through the registry, on each command, and at the runtime
door it rides.
- Ablation (each restored, verified): kanban check removed → 7 failed;
filter check removed → 7 failed; master-detail exemption removed → 1
failed (first round); relatedLists/page exemption removed → 1 failed;
list-entry (`recordId`) gate removed → 1 failed (this round).
</details>
<details><summary>CLI scaffold pins, showcase, dogfood</summary>
- `generate-scaffold-gates.e2e.test.ts` +
`generate-scaffolds-reach-stack.e2e.test.ts` (`OS_TEST_TIERS=nightly`,
at 17f62e7; the two files unchanged since): Test Files 2 passed, Tests
77 passed. Before the test rework they measured 2 failed / 74 passed,
which is how the pins below were found.
- `pnpm --filter @objectstack/cli exec vitest run --project unit`:
445/446 files passed, the one red file
`generate-scaffold-validates.test.ts` (3 tests) fixed and re-run at
d95f7a4: 26/26 passed.
- `examples/app-showcase`: whole suite 49 files, 546 tests passed;
`author-time-advisories.test.ts` 2/2.
- Dogfood battery at d95f7a4 (the later commit is three CLI test
fixtures, off the dogfood path): `VERDICT command-exit 0`, Test Files
490 passed + 3 skipped (493), Tests 4144 passed + 68 skipped (4212).
- CLI integration fixtures CI found red on d95f7a4 (`Test Core
(5/10)`): `lint-per-package-authoring-parity`, `package-union-readers`,
`stack-conversion-record-door` now open their objects from navigation,
each on a declared list (the parity fixture's orders package contributes
its entry into core's app). Re-run locally at 2399eab: 3 files, 34
tests passed.
- First round, unchanged code paths: metadata-protocol 372 files + 9
skipped; objectql 643/643; runtime 659 files, all `VERDICT command-exit
0`.
</details>
## Acceptance notes
- **Seat rulings applied**: `Clause-②: yes (narrowing)` (six rule-id
exports enlarge the `.` entry); `dashboard-without-widgets` is a warning
at both doors, and `validateWidgetBindings` no longer takes an options
argument, so its signature is unchanged from main.
- **Scaffold pins (M1/M2), settled per pin, none loosened to a filter by
rule:**
- `os g object` (and every leg that generates an object) now meets
`object-unreachable-from-navigation`. Making the scaffold silent would
need `os g` to edit the author's app, which #32153 rules out (`os g`
never edits an app). The finding is true and the author's to answer, as
`nav-object-ungranted` already is in the same file, so each leg pins
that it fires only on objects the leg generated, then answers it as the
starter app's own header tells the author to (the entry the hint names,
then `os g view` for an object that reports `object-without-view`)
before the three gates run, which stay at zero findings.
- `os g dashboard` writes `widgets: []` under a comment naming the
widget shape; a widget needs a dataset and measures only the author can
choose. `dashboard-without-widgets` is carried in a
`SCAFFOLD_ADVISORIES` ledger with that reason, pinned to fire at every
gate in the dashboard leg and in no other leg. Same ledger in the
in-process pin.
- `os g app` opens the object it binds, which has no list view; the
in-process pin answers it with `os g view` and pins that `app` is the
only scaffold that needs it. `generate.ts` is unchanged, so no
`@objectstack/cli` changeset.
- **Showcase (M2)**: 16 new advisories, each listed with its reason in
`author-time-advisories.test.ts`: 8 `object-without-view` (objects on
the console's derived list; designing those lists would change what
browser checklist items observe) and 8
`object-unreachable-from-navigation` (objects kept off navigation on
purpose: OWD siblings, share-link, public-form inbox, semantic-roles
fixtures, federated externals). `showcase_private_note` is linked by URL
from the Capability Map page, which the rule does not read.
- **S3**: an object another object names in `relatedLists`, or that a
page opened by a `type: 'page'` entry names (an `object` / `objectName`
value), is not judged; the message claims only that no navigation entry
opens the list, and the hint no longer prescribes a `master_detail`
field.
- **S2**: `object-without-view` reads `ObjectSchema.listViews`, names it
in the hint, explanation and changeset; the dead `obj.list` read is
gone. **N1**: an entry with `recordId` owes no list view. **N2**: the
one-element holder indirection is gone; `viewBinds` still duplicates the
list-view walk in `validate-list-view-field-refs.ts` (left, noted).
**N3**: board messages for `rating` / `formula` grouping left generic
(noted).
- **Corpus**: app-crm and app-multi-package exit 0 with
`object-without-view` for objects with no list view; app-todo clean.
hotcrm at 99a4279, a static reading (not a run): every object file is
named by some `objectName`, has a `master_detail` field, or is in a
`relatedLists`, so no unreachable finding is expected; kanbans group by
select or lookup; no empty dashboards.
- **Not judged**: `userFilters.fields` for formula fields; boolean
grouping counts as categorical.
- **Merge**: main merged twice; the rule counts read 90 (main 88 + two),
confirmed by `check:docs-transcript-drift`. The "Test UI" red on
1d79fae was all 16 shards cancelled by the next push, not a test
failure.
- **Surface outside `packages/lint/**`** (admitted by the seat's claim
note): docs rows and counts, the changeset, the spec semantic entry,
`packages/cli/test/**`, `examples/app-showcase/test/**`.
## Verification
Two-minute check: `pnpm --filter @objectstack/lint exec vitest run
--maxWorkers=2 src/validate-app-shell-reach.test.ts`. Expected: all
tests pass. Or `os validate` in `examples/app-crm`: exit 0 with
`object-without-view` warnings for `crm_account` and `crm_contact`.
Read first (by risk):
1. `packages/lint/src/validate-list-view-field-refs.ts`:
`checkFilterVirtual`, the only new error, at every door.
2. `packages/lint/src/validate-app-shell-reach.ts`: what counts as reach
(`collectNav`, `shownElsewhere`) and the list-entry gate.
3. `packages/cli/test/generate-scaffold-gates.e2e.test.ts`:
`answerAppShell` and `SCAFFOLD_ADVISORIES`.
<details><summary>Local gates</summary>
119 derived families (`dispatch-gates.mjs --commands` at d95f7a4);
`--ran` reconciliation with exit codes: 115 exit 0, 4 NOT MEASURED, each
exit 3 PREREQUISITE NOT MET: `check-plugin-teardown-shape --self-test`
(shallow clone), spec `check:skill-examples` (client-react dts),
`check:dual-build-cjs-loads` (unbuilt), `check:type-check-debt` (lock
queue-timeout behind this PR's own dogfood run).
`check:docs-transcript-drift` and `check-nul-bytes` re-run at 2399eab,
exit 0. CI owns the farm.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [ ] 3. No formatter ran; `pnpm lint` is the CI-owned repo scan, not
run locally.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
<!-- signed: repo:objectstack#6 · hotlong ·
session_01Q4EjjQkY5yXZrN9BEA3rEK -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4f7aa88 commit d578952
23 files changed
Lines changed: 1304 additions & 25 deletions
File tree
- .changeset
- content/docs
- deployment
- getting-started
- ui
- examples/app-showcase/test
- packages
- cli/test
- lint/src
- spec/src/migrations/entries/semantic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
940 | | - | |
| 940 | + | |
941 | 941 | | |
942 | 942 | | |
943 | 943 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
| 503 | + | |
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
| 517 | + | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
| |||
870 | 872 | | |
871 | 873 | | |
872 | 874 | | |
873 | | - | |
| 875 | + | |
874 | 876 | | |
875 | 877 | | |
876 | 878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
| |||
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
150 | 175 | | |
151 | 176 | | |
152 | 177 | | |
| |||
0 commit comments