Skip to content

Commit 8923843

Browse files
os-zhuangclaude
andauthored
fix(skills,docs): align skills/docs with published spec; guard flat view containers (#3096)
Fixes the five skill/doc-vs-spec drifts found by the 2026-07-17 third-party evaluation of the 15.1.0 release (AI following the official skills produced metadata that failed or silently broke): 1. objectstack-data skill taught `defineDataset()` for seeds — the actual export is `defineSeed()` (`dataset` is reserved for the ADR-0021 analytics layer). Renamed the whole section incl. imports, type table, zod path. 2. Same skill taught a `type: 'unique'` validation — removed from the spec in #1475. Now teaches `indexes: [{ fields, unique: true }]`; also purged the fictional `async`/`custom` types from rules/validation.md, fixed `format.pattern`→`regex` (no `uuid` builtin), `conditional` to its real `when`/`then`/`otherwise` shape, converted all predicates to record-rooted CEL (`P` tag), and documented that `cross_field` is failure-condition (inverted) like `script`, per the runtime rule-validator. 3. objectstack-ui skill kanban example used a top-level `groupBy` — the real shape is nested `kanban: { groupByField, summarizeField, columns }` with top-level `columns` still required. Gantt examples had the same flat disease with wrong key names (`startField`/`dependencyField` → `gantt.startDateField`/`dependenciesField`); `timeSegments` moved inside the `gantt:` block; column `summary` is a plain enum, not an object. Added a `defineView` container primer to the skill. 4. docs ui/views taught flat view objects that `os validate` passed but the Console silently never rendered (ViewSchema strips unknown keys → empty container). Page rewritten around the `defineView({ list, listViews, formViews })` container + stack registration; property tables corrected (`columns` required; `name`/`label` optional; `span` over legacy `colSpan`; `visibleWhen` is record-rooted CEL). 5. README quickstart curl path `/api/v1/todo_task` → `/api/v1/data/todo_task`. Root-cause guard for #4: `defineView()` now throws on a container with zero views, and `os validate` gains a `view-container-shape` check (`validateViewContainers` in @objectstack/lint, run PRE-parse like the ADR-0053 check) reporting flat/empty `views: []` entries with a fix hint. The runtime view type-schema mapping is deliberately untouched (ViewItem + container + #2555 personalization shapes need their own change). Regenerated skills/README.md + content/docs/ai/skills-reference.mdx via gen:skill-docs. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 37c12e8 commit 8923843

16 files changed

Lines changed: 679 additions & 259 deletions

File tree

.changeset/tidy-views-guard.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@objectstack/spec": patch
3+
"@objectstack/lint": patch
4+
"@objectstack/cli": patch
5+
---
6+
7+
Reject view containers that define no views. A flat list-view object (`{ name, label, type, columns, ... }`) parses to an empty `ViewSchema` container because Zod strips unknown keys — zero views register and the Console silently renders nothing. `defineView()` now throws on a zero-view container, and `os validate` gains a `view-container-shape` check (`validateViewContainers` in `@objectstack/lint`) that reports flat or empty `views: []` entries pre-parse with a wrap-it fix hint.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Every object ships a REST API automatically — no controllers to write:
184184

185185
```bash
186186
# CRUD endpoints for the `todo_task` object you defined above
187-
curl http://localhost:3000/api/v1/todo_task
187+
curl http://localhost:3000/api/v1/data/todo_task
188188
```
189189

190190
For the browser, the typed client SDK and React hooks (`useQuery` / `useMutation` / `usePagination`) live in [`@objectstack/client-react`](packages/client-react). Need a new capability? Write a plugin, driver, or service against the same kernel APIs — every built-in is one (see below).

content/docs/ai/skills-reference.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ObjectStack ships **9 domain-specific skills**. Each is self-contained — an AI
4646
| # | Skill | Domain | Path | What it covers |
4747
| :--- | :--- | :--- | :--- | :--- |
4848
| 1 | [Platform](#platform) | `platform` | `skills/objectstack-platform/` | Bootstrap, configure, extend, and operate ObjectStack runtimes. Covers project setup (`defineStack`, drivers, adapters, scaffolding), plugin and service development (PluginContext, DI, kernel hooks like `kernel:ready` and `data:*`), and operations (CLI commands, migrations, deployment, test harnesses via LiteKernel). |
49-
| 2 | [Data](#data) | `data` | `skills/objectstack-data/` | Design ObjectStack data schemas — objects, fields, field conditional rules, relationships, validations, indexes, lifecycle hooks, permissions, row-level security — and the seed datasets (`defineDataset()`) that load fixtures and reference data alongside them. |
49+
| 2 | [Data](#data) | `data` | `skills/objectstack-data/` | Design ObjectStack data schemas — objects, fields, field conditional rules, relationships, validations, indexes, lifecycle hooks, permissions, row-level security — and the seeds (`defineSeed()`) that load fixtures and reference data alongside them. |
5050
| 3 | [Query](#query) | `query` | `skills/objectstack-query/` | Construct ObjectQL queries — filters, sorting, pagination, aggregation, joins/expansion, window functions, and full-text search. |
5151
| 4 | [UI](#ui) | `ui` | `skills/objectstack-ui/` | Author ObjectStack UI metadata — Views (list/form/kanban/calendar/gantt), Apps (navigation), Pages (structured plus the HTML and React source-authoring tiers, ADR-0080/0081), Dashboards, Reports, Charts, Actions, and package Docs (`src/docs/*.md`). |
5252
| 5 | [Automation](#automation) | `automation` | `skills/objectstack-automation/` | Design ObjectStack automation — Flows (visual logic), Workflows (declarative rules), Triggers, Approvals, scheduled jobs, and webhooks. |
@@ -75,13 +75,13 @@ Do not use for data schema design (see objectstack-data) or query patterns (see
7575

7676
**Domain** `data` · **Path** `skills/objectstack-data/`
7777

78-
Design ObjectStack data schemas — objects, fields, field conditional rules, relationships, validations, indexes, lifecycle hooks, permissions, row-level security — and the seed datasets (`defineDataset()`) that load fixtures and reference data alongside them.
78+
Design ObjectStack data schemas — objects, fields, field conditional rules, relationships, validations, indexes, lifecycle hooks, permissions, row-level security — and the seeds (`defineSeed()`) that load fixtures and reference data alongside them.
7979

8080
Use when the user is creating or modifying `*.object.ts` / `*.seed.ts` files, picking field types, modelling relationships, writing `beforeInsert`/`afterUpdate` hooks, configuring per-object access control, or authoring bootstrap / demo data. Use for `visibleWhen` / `readonlyWhen` / `requiredWhen` rules that belong on fields.
8181

8282
Do not use for querying data (see objectstack-query) or for plugin / kernel hooks (see objectstack-platform). CEL expressions in formulas / validations / sharing rules / dynamic seed values: load objectstack-formula alongside.
8383

84-
**Tags:** `object`, `field`, `validation`, `index`, `relationship`, `hook`, `schema`, `permission`, `rls`, `security`, `seed`, `dataset`, `fixture`
84+
**Tags:** `object`, `field`, `validation`, `index`, `relationship`, `hook`, `schema`, `permission`, `rls`, `security`, `seed`, `fixture`
8585

8686
---
8787

0 commit comments

Comments
 (0)