Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .changeset/35143-views-dashboards-checks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
'@objectstack/lint': minor
'@objectstack/spec': patch
---

fix(lint)!: publish-time checks for views, dashboards and the app shell that save and do not work

Clause-②: yes (narrowing)
Metadata-protocol: narrowed

<!-- adr-0087: registered publish-refuses-views-and-dashboards-that-save-and-do-not-work -->

**BREAKING** for a list view filter keyed on a `formula` field: it was accepted before and is refused now, with the fix named in the finding. The schema is unchanged and stored metadata is not rewritten or refused at boot; the refusal comes at the next publish, and from `os validate` / `lint` / `compile` / `build`.

- `list-view-filter-field-virtual` (error): a list view's own `filter`, or a `userFilters.tabs[]` preset, keyed on a field computed on read (`formula`). The engine refuses every query filtered on such a field (`400 INVALID_FIELD`), so the view opens on that error every time. Refused at the runtime publish door on a `view` write and on an `object` write through the object's own `listViews`. A dotted key whose head is a formula stays `list-view-field-dotted`; the filter bar's field list (`userFilters.fields`) is not judged.
- `dashboard-without-widgets` (warning, every door): a dashboard with `widgets: []`, which opens on its header over an empty canvas. Advisory because the shape breaks no request and the platform's own create steps (Studio, the spec's create seed, `os generate dashboard`) write it and fill it afterwards.
- `list-view-kanban-group-field-uncategorical` (warning): a `kanban` board grouped by a field with no fixed set of lanes. A text, number or date field gets one lane per distinct value on the loaded cards and no lane for a value no card holds; a multi-valued field puts a card holding several values in one lane named by all of them. A `select` / `radio`, a boolean and a single-valued reference are silent. Runs on the runtime `view` and `object` doors.
- `app-navigation-empty` (warning): an app with no entry in `navigation` nor in any `areas[].navigation` (a separator or an empty group counts as nothing), and no navigation the stack contributes into it. It opens on the "no access" empty state for every member. Runs on the runtime `app` door.
- `object-unreachable-from-navigation` and `object-without-view` (warnings, `os validate` / `lint` / `build` only): an object no navigation entry opens (not judged: a `master_detail` child, an object another object names in `relatedLists`, an object a page names when navigation opens that page, an API-disabled object, and a stack with no app), and an object navigation opens as a list that declares no `listViews` entry and no bound `views` item, which then opens on the console's own "All records" tab. Fix: `listViews: { all: { type: 'grid', columns: [...] } }` on the object, or a `views` entry bound to it.

## FROM → TO

- `filter: [{ field: 'is_overdue', operator: 'equals', value: true }]` where `is_overdue` is a `formula` → `filter: [{ field: 'due_date', operator: 'lt', value: '{today}' }]` (the stored field the formula reads), or a stored field written when its sources change.

`@objectstack/lint` exports six rule id constants (`LIST_VIEW_FILTER_FIELD_VIRTUAL`, `LIST_VIEW_KANBAN_GROUP_FIELD_UNCATEGORICAL`, `DASHBOARD_WITHOUT_WIDGETS`, `APP_NAVIGATION_EMPTY`, `OBJECT_UNREACHABLE_FROM_NAVIGATION`, `OBJECT_WITHOUT_VIEW`) so `os explain` carries an entry for each; the two new rule functions are not exported. `@objectstack/spec` adds only the upgrade-guide entry `publish-refuses-views-and-dashboards-that-save-and-do-not-work`.
2 changes: 1 addition & 1 deletion content/docs/deployment/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ os compile --json # JSON output for CI pipelines
→ Normalizing stack definition...
→ Lowering inline handlers...
→ Validating protocol compliance...
→ Running author-time rules (88)...
→ Running author-time rules (90)...
→ Checking that every required capability has a provider installable in this edition...
→ Collecting package docs (ADR-0046)... 0 collected
→ Writing artifact...
Expand Down
8 changes: 5 additions & 3 deletions content/docs/deployment/validating-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -500,19 +500,21 @@ orthogonal to both, and no cell here can carry it; it is written out in
| Retired object title template — an object that declares `titleFormat`, retired by ADR-0079 for `nameField` (`title-format-retired`, #29007) | ✓ | ✓ | ✓ | ✓ᵒ |
| Roll-up aggregands — a `summaryOperations` `min` / `max` whose answer is not a number, or a `sum` / `avg` over a child field type the aggregate × field-type table refuses (`rollup/non-numeric-aggregand`) | ✓ | ✓ | ✓ | ✓ᵒ |
| View container shape | ✓ | ✓ | ✓ | — |
| Widget-binding integrity (ADR-0021) | ✓ | ✓ | ✓ | ✓ᵈ |
| Widget-binding integrity (ADR-0021) — and a dashboard with no widgets, which opens on its header over an empty canvas (`dashboard-without-widgets`, #35143): a warning at every door, since Studio, the create seed and `os generate dashboard` write it empty and fill it afterwards | ✓ | ✓ | ✓ | ✓ᵈ |
| Dataset measure `aggregate` × the field's declared type — a pair the spec's compatibility table refuses, e.g. `avg` over a `datetime` field (#16354) | ✓ | ✓ | ✓ | ✓ᵈᵗ |
| Dashboard action/route references (ADR-0049) | ✓ | ✓ | ✓ | — |
| Filter placeholder resolvability (#3574) | ✓ | ✓ | ✓ | — |
| Ordering comparands naming a date-range preset — `last_30_days` in a `>=` position (#8793) | ✓ | ✓ | ✓ | ✓ᵈᵛᵒᵖᶠʳ |
| Empty filter combinators — `$and: []`, `$or: []`, `$not: {}` (#5330) | ✓ | ✓ | ✓ | ✓ᶠʳ |
| Object & action name references (#3583) — and the object a seed dataset, a flow `get_record` / `create_record` / `update_record` / `delete_record` / object-form `screen` node or a standalone action is bound to (`object-reference-unknown`, #35143); a flow node's miss is a warning on the CLI, where a declared dependency may define the object, and an error at the publish door; at the publish door a seed over an unknown object is the save door's own refusal (#34864) | ✓ | ✓ | ✓ | ✓ᶠᵈᵗᵃᶜ |
| Reference integrity — flow node writes, template paths, read-only writes (#3583); at the publish door each write type runs only the members that declare it, and the flow members run on `flow` alone (#9313) | ✓ | ✓ | ✓ | ✓ᶠᵛᵒᵈᵗʳᵖᵃᶜ |
| List-view field members — a list view's `sort` (a `sortable: false` field, a `formula`, an unknown name: `sort-field-unsortable`), its `searchableFields` (`searchable-field-unknown`) and its field references, columns, filter keys, grouping and the board bindings (`list-view-field-unknown`); the row merges three members, so its codes follow no one rule's order, and the `page` door runs the sort member only (#9313, #15495, #30095) | ✓ | ✓ | ✓ | ✓ᶠᵛᵒᵖ |
| List-view field members — a list view's `sort` (a `sortable: false` field, a `formula`, an unknown name: `sort-field-unsortable`), its `searchableFields` (`searchable-field-unknown`) and its field references, columns, filter keys, grouping and the board bindings (`list-view-field-unknown`); a filter key on a `formula` field, which the engine refuses to filter by (`list-view-filter-field-virtual`, #35143), and, advisory, a board grouped by a field with no fixed set of lanes (`list-view-kanban-group-field-uncategorical`, #35143); the row merges three members, so its codes follow no one rule's order, and the `page` door runs the sort member only (#9313, #15495, #30095) | ✓ | ✓ | ✓ | ✓ᶠᵛᵒᵖ |
| Page-component field bindings (#3583) | ✓ | ✓ | ✓ | ✓ᶠ |
| React page block field bindings — §10 (#4340) | ✓ | ✓ | ✓ | ✓ᶠ |
| Chart bindings outside dashboards (#3583) | ✓ | ✓ | ✓ | ✓ᶠʳᵛᵒ |
| Navigation vs. granted access (ADR-0090 D6) | ✓ | ✓ | ✓ | ✓ᶠ |
| App shell, advisory — an app with no navigation entry, which opens on the "no access" empty state (`app-navigation-empty`, #35143) | ✓ | ✓ | ✓ | ✓ᵃ |
| App shell reach, advisory — an object no navigation entry, navigated page or parent's `relatedLists` shows (`object-unreachable-from-navigation`) and an object navigation opens as a list with no `listViews` entry or bound view (`object-without-view`, #35143); they read every app, view and object of the stack, which no per-write snapshot carries | ✓ | ✓ | ✓ | — |
| SDUI scoped styling (ADR-0065) | ✓ | ✓ | ✓ | — |
| SDUI component props — every `ComponentPropsMap` verdict: an undeclared prop, a value its props schema rejects, a missing `dataSource.object` binding, and a retired prop (`retiredKey()`) refused with its prescription (#23026, #23147; at the save door #23388) | ✓ | ✓ | ✓ | ✓ᵖ |
| Page component types inside a spec-reserved namespace — a type the platform does not declare, e.g. `global:serch` (`component-type-unknown`, ADR-0078; at the save door #23388) | ✓ | ✓ | ✓ | ✓ᵖ |
Expand Down Expand Up @@ -870,7 +872,7 @@ A clean run walks the registry and reports timing:
Config: /path/to/support-desk/objectstack.config.ts
Load time: 21ms
→ Validating against ObjectStack Protocol...
→ Running author-time rules (88)...
→ Running author-time rules (90)...
→ Checking that every required capability has a provider installable in this edition...
→ Checking package docs (ADR-0046)...

Expand Down
2 changes: 1 addition & 1 deletion content/docs/getting-started/build-with-claude-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ visible: 'status != "resolved"'
◆ Validate
────────────────────────────────────────
→ Validating against ObjectStack Protocol...
→ Running author-time rules (88)...
→ Running author-time rules (90)...

✗ Author-time rules failed (1 issue)
• stack · action 'resolve_ticket' visible: bare reference `status` — a
Expand Down
2 changes: 1 addition & 1 deletion content/docs/ui/react-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ objectstack validate
────────────────────────────────────────
→ Loading configuration...
→ Validating against ObjectStack Protocol...
→ Running author-time rules (88)...
→ Running author-time rules (90)...
→ Checking that every required capability has a provider installable in this edition...
→ Checking package docs (ADR-0046)...

Expand Down
25 changes: 25 additions & 0 deletions examples/app-showcase/test/author-time-advisories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ const NESTED_FAN_OUT =
+ 'pinned by test/nested-fan-out-region-indices.test.ts. Wrapping the notify step in a try_catch puts a region '
+ 'between the parallel branch and the step whose (iteration, branch) tags the clause reads.';

const DERIVED_LIST =
'Opened from the app\'s navigation on the console\'s own derived list ("All records": the name field and '
+ 'highlightFields, or the first five fields). The showcase demonstrates designed lists on projects, tasks, '
+ 'contacts and the field zoo; this object keeps the derived one, and declaring a list here would change what '
+ 'the browser checklist items on it observe. #35143 made the advisory; designing the list is a separate change.';

const OFF_NAVIGATION =
'Deliberately not in the app\'s navigation: the object exists to demonstrate a server-side contract (sharing '
+ 'model, share links, a public form, federation, or served semantic roles) that its tests drive over REST, '
+ 'and the app shell is not what it shows. The rule claims only that no navigation entry opens its list.';

export const ALLOWED_ADVISORIES: readonly Allowed[] = [
// ── Approval slates (info) ───────────────────────────────────────────────
{ rule: 'approval-approvers-may-resolve-empty', where: 'flow "showcase_expense_signoff" · node "dual_signoff"', reason: POSITION_SLATE },
Expand Down Expand Up @@ -147,6 +158,20 @@ export const ALLOWED_ADVISORIES: readonly Allowed[] = [
reason: 'A junction row: every surface that lists it names it by its two masters (team and project), and it '
+ 'has no text field for nameField to point at. Records fall back to the stable Record #ID floor.',
},

// ── App shell (#35143): the derived list, and objects kept off navigation (warning) ──
...['showcase_account', 'showcase_cascade', 'showcase_category', 'showcase_expense_report', 'showcase_invoice',
'showcase_preference', 'showcase_product', 'showcase_team'].map((name): Allowed => ({
rule: 'object-without-view', where: `object "${name}"`, reason: DERIVED_LIST,
})),
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_announcement"', reason: OFF_NAVIGATION + ' Public-read OWD sibling of showcase_private_note.' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_private_note"', reason: OFF_NAVIGATION + ' Owner-private OWD; the Capability Map page links to it by URL, which the rule does not read.' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_client_brief"', reason: OFF_NAVIGATION + ' The share-link (publicSharing) object, opened by its capability token.' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_inquiry"', reason: OFF_NAVIGATION + ' The public form\'s inbox; the Contact Form page submits into it.' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_semantic_zoo"', reason: OFF_NAVIGATION + ' A served-pipeline fixture of the semantic-roles dogfood test.' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_semantic_zoo_legacy"', reason: OFF_NAVIGATION + ' The legacy-spelling twin of showcase_semantic_zoo, same dogfood test.' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_ext_customer"', reason: OFF_NAVIGATION + ' Federated read-only from the external SQLite datasource (ADR-0015).' },
{ rule: 'object-unreachable-from-navigation', where: 'object "showcase_ext_order"', reason: OFF_NAVIGATION + ' Federated read-only from the external SQLite datasource (ADR-0015).' },
];

/**
Expand Down
Loading
Loading