Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8a3430a
feat(spec)!: form is a metadata type of its own, and the form doors r…
claude Nov 26, 2026
a1bd3fe
fix(37086): gate findings — collection-map waivers, restore-door dele…
claude Nov 26, 2026
d7eb41b
fix(37086): i18n for the form type — platform-objects form label bund…
claude Nov 26, 2026
196b3a1
fix(37086): package tests — form doors project old shapes from a prot…
claude Nov 26, 2026
d649e85
test(form): census cells and ratchets for the form type
claude Nov 26, 2026
32eb003
chore(changeset): name platform-objects, whose bundles ship the form …
claude Nov 26, 2026
0c972e7
fix(lint): a form item's named sections are _sections anchors of its …
claude Nov 26, 2026
bbf7965
Merge branch 'claude/project-thread-pu5dnt' of https://github.com/obj…
claude Nov 26, 2026
9d212c3
fix(ui,rest): the form type in the Studio and console tables CI read
claude Nov 26, 2026
d536707
chore(changeset): the console strings for the form type
claude Nov 26, 2026
2da1058
chore(ui): the types FormSchema is a different concept from the spec'…
claude Nov 26, 2026
dcee5d4
Merge branch 'claude/project-thread-pu5dnt' of https://github.com/obj…
claude Nov 26, 2026
6103f74
docs(skills): the platform skill lists forms among the stack's top-le…
claude Nov 26, 2026
97341d5
docs: CLI transcripts count 82 author-time rules on the merged tree
claude Nov 26, 2026
7512aae
Merge branch 'claude/project-thread-pu5dnt' of https://github.com/obj…
claude Nov 26, 2026
995bbce
fix(metadata-protocol,rest): judge the address clash at publish and r…
claude Nov 26, 2026
e934757
test(rest): pin the form half of the layer, served rows, the closed r…
claude Nov 26, 2026
db4d24e
fix(rest,metadata-protocol): the form read gate on the cached plain r…
claude Nov 26, 2026
89858b3
feat(spec): forms.NAME.sections, read before the object-level _sectio…
claude Nov 26, 2026
7185b8a
test(rest): hold the old shapes and the CRM's public form to answers …
claude Nov 26, 2026
08b199e
docs(qa): the form waiver names the showcase's authored form and card…
claude Nov 26, 2026
b1a2994
docs(spec,scripts): the form sharing ledger row cites the form doors,…
claude Nov 26, 2026
67af96f
fix(scripts,rest): the examples coupling gate asks the task that runs…
claude Nov 26, 2026
7ffc21f
fix(metadata-protocol): the undo of a refused publish and a commit re…
claude Nov 26, 2026
7b0f2f8
test(rest): the undo of a refused package publish and a commit revert…
claude Nov 26, 2026
8ccb511
fix(lint,cli): a form item's section copy is extracted, covered and j…
claude Nov 26, 2026
95cb02a
test(cli): the form item section coverage pin reads the form's own keys
claude Nov 26, 2026
7e3b3d2
docs(changeset): the form type's entry names the undo of the old-shap…
claude Nov 26, 2026
d204950
test(metadata-protocol): the stored-row write census lists the old-sh…
claude Nov 26, 2026
6bea26c
fix(metadata-protocol): a rolled-back transaction retires the overlay…
claude Nov 26, 2026
c75ea62
test(metadata-protocol, rest): a package publish refused part-way on …
claude Nov 26, 2026
0496390
test(metadata-protocol): the overlay cache pins pay the protocol's la…
claude Nov 26, 2026
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
36 changes: 36 additions & 0 deletions .changeset/37086-form-metadata-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@objectstack/spec': minor
'@objectstack/metadata-protocol': minor
'@objectstack/rest': minor
'@objectstack/lint': minor
'@objectstack/metadata': minor
'@objectstack/metadata-core': minor
'@objectstack/objectql': minor
'@objectstack/runtime': minor
'@objectstack/cli': minor
'@objectstack/platform-objects': minor
---

feat(spec)!: `form` is a metadata type of its own — `defineForm`, `*.form.ts` and a stack's `forms:` — and the anonymous form doors read a form over both types (ADR-0159 card ②)

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

ADR-0159 makes a public form a `form` item: `name` (`OBJECT.KEY`, the name it is served under), `object` (its one binding) and a form view's body at the top level, its keys taken from `FormViewSchema` by reference. A stack lists them under `forms:`, one per `*.form.ts` module built with `defineForm`. The three old `view` shapes that carry a form (a container's `form`, a `formViews` entry, a `viewKind: 'form'` item) keep loading and serving exactly as before: one projection reads them as `form` items, under the names they are served as today, and nothing an author wrote stops loading.

`@objectstack/platform-objects` ships the `form` type's display label in its metadata-form bundles, translated in every bundled locale.

<!-- adr-0087: registered form-type-define-form-and-packageless-list-at-form-name -->

**BREAKING** (the protocol is narrowed, and a published export changes meaning):

- **The export.** `defineForm` on `@objectstack/spec` and `@objectstack/spec/ui` builds a `form` item. FROM: (since the previous change) no `defineForm`; before that, the Studio metadata-form helper. TO: `defineForm({ name: 'crm_lead.web_to_lead', object: 'crm_lead', sections, sharing })`. The fix for a Studio form: `defineMetadataForm`, as the rename's own entry says; the compiler names every call (a Studio body is refused by `FormSchema`: it has no `name` and `object`).
- **The refusal.** A package-less `view` write that would store a LIST at a name a read-only package authors as a `form` item is refused with `400 VALIDATION_ERROR`, naming the package — on the save, on the publish of a draft saved before the gate, and on a rollback or revert that restores such a body. Items and container expansions alike. Saves admitted today that it refuses: a list at a name several packages ship; a list at a name whose base has no pair; a re-save of a row the base's pair already holds; a container that overlays the package's own. The door that remains: save the list under another key, or into an app of the environment's own. It bites for a name only from the release in which a package authors it as a `form` item.

What lands with the type:

- `@objectstack/spec`: `FormSchema`, `defineForm`, the registry row (`*.form.ts|yml|json`, overlay-capable, no environment overlay), `form` in the customization package's listed types, the stack's `forms` collection, the `forms` translation family (`forms.NAME` first, the `_views.KEY` title and thank-you tails as the fallback, `_views.KEY.label` never read; a form's own section copy at `forms.NAME.sections.SECTION`, with `objects.OBJECT._sections.SECTION` as its object-level default), the projection `projectViewForms`, the intake layer `formIntakeLayer` / `openFormAt`, and the error code `FORM_ADDRESS_TAKEN`.
- `@objectstack/metadata-protocol`: the effective `form` read resolves a form over both types in the one served-row order (a stored `view` row over a package's form keeps replacing it when the package moves to `forms:`); a `form` save, reset or delete at a package removes that package's old-shape row of the name in the same transaction (form content only — a list of the name is untouched), and the undo of that write puts the row back: a package commit records the row as one its publish edited, so the commit's revert restores it, and a refused package publish undone on a runtime that cannot roll back restores it at its version; a `form` left open on a public address another form holds is refused with `409 FORM_ADDRESS_TAKEN`, naming both, on the save, on the publish of a draft whose address another form took after it was saved, and on a rollback to a version open on a held address (a switched-off form that keeps its link still holds the address; a write that leaves the form closed is never refused); the override gate accepts a `form` override over a base that ships the form as an old shape; a stored body whose form content cannot be read closes the links it names and is reported once per process, at `error`, the first time the form doors read it, naming the row, the links it closes and the repair save; and a transaction the protocol opens that rolls back after writing metadata rows retires the overlay read cache, so a read after a refused package publish answers the store as the rollback left it.
- `@objectstack/rest`: `GET /forms/:slug` and its submit read candidates from the effective `form` read and judge withdrawal across `form` and `view`, effective and per-package, old shapes projected first — narrowing only, in both directions; a body that cannot be read closes the links it names. `/meta/form/NAME` refuses whom `/meta/view/NAME` refuses. `GET /meta/view` answers as before.
- `@objectstack/lint`: `form-public-address-taken` (gating), `form-consumer-less` (advisory, never for an `overrides` item), `form-object-outside-closure` / `form-object-unknown`; the i18n walk emits `forms.NAME.*` keys and no `_views` tail for a `form` item, a form's section copy at `forms.NAME.sections.SECTION` with `objects.OBJECT._sections.SECTION` as the address it falls back to; the translation reference lint judges a `forms.NAME.sections` key against the form's named sections and their entries. No new advisory for an old shape.
- `@objectstack/metadata`, `@objectstack/metadata-core`, `@objectstack/objectql`, `@objectstack/runtime`, `@objectstack/cli`: the `forms` collection is loaded, typed, registered and counted for i18n coverage like every other; in `@objectstack/cli` a key translated at the address the walk names as its fallback is covered, and `os i18n extract` scaffolds no translated-locale value over one.
11 changes: 11 additions & 0 deletions .changeset/37086-form-type-console-strings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
---

fix(console): the console reads the new `form` type — Studio's translation preview, the pending-changes count and the served `forms` translation group

Clause-②: no
Metadata-protocol: none

ADR-0159 card ② (#37086) makes `form` a metadata type of its own with a `forms` translation group. The Studio translation preview now draws a Forms card (en "Forms", zh 表单), the pending-changes summary counts a drafted form as "1 form" / "2 forms" in every bundled locale, and the console's language loader recognises a served document that carries only `forms`. Studio's directory and left menu do not list the `form` type yet: card ③ (#37087) brings its designer and its menu placement.
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 (80)...
→ Running author-time rules (82)...
→ Checking that every required capability has a provider installable in this edition...
→ Collecting package docs (ADR-0046)... 0 collected
→ Writing artifact...
Expand Down
2 changes: 1 addition & 1 deletion content/docs/deployment/validating-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,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 (80)...
→ Running author-time rules (82)...
→ 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 @@ -311,7 +311,7 @@ visible: 'status != "resolved"'
◆ Validate
────────────────────────────────────────
→ Validating against ObjectStack Protocol...
→ Running author-time rules (80)...
→ Running author-time rules (82)...

✗ Author-time rules failed (1 issue)
• stack · action 'resolve_ticket' visible: bare reference `status` — a
Expand Down
3 changes: 2 additions & 1 deletion content/docs/references/api/automation-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ const result = AutomationApiErrorCode.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +381 more>` | ✅ | The inner refusal's code in its WIRE spelling - the ADR-0112 member a record save of the same write answers in `error.code` (e.g. `UNIQUE_VIOLATION`); the closed set `ApiErrorSchema.code` parses against |
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +382 more>` | ✅ | The inner refusal's code in its WIRE spelling - the ADR-0112 member a record save of the same write answers in `error.code` (e.g. `UNIQUE_VIOLATION`); the closed set `ApiErrorSchema.code` parses against |
| **message** | `string` | ✅ | The inner refusal's own diagnostic text, verbatim, without the node and operation prefixes the run's failure text adds |

### Allowed Values: `FlowInnerRefusal.code`
Expand Down Expand Up @@ -615,6 +615,7 @@ const result = AutomationApiErrorCode.parse(data);
* `FLOW_INPUT_SCHEMA_INVALID`
* `FLOW_NO_START_NODE`
* `FORBIDDEN`
* `FORM_ADDRESS_TAKEN`
* `FORM_NOT_FOUND`
* `FORM_RESOLVE_FAILED`
* `HOOK_ABORTED`
Expand Down
3 changes: 2 additions & 1 deletion content/docs/references/api/contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const result = ApiErrorSchema.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +381 more>` | ✅ | Error code (e.g. VALIDATION_ERROR; StandardErrorCode ∪ the ledger the serving side registers — ERROR_CODE_LEDGER for framework packages) |
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +382 more>` | ✅ | Error code (e.g. VALIDATION_ERROR; StandardErrorCode ∪ the ledger the serving side registers — ERROR_CODE_LEDGER for framework packages) |
| **declaredCode** | `string` | optional | The producer-declared code, verbatim, when it is not a member of the closed `code` vocabulary — the open, author-authored channel (app-specific spellings; ADR-0112) |
| **message** | `string` | ✅ | Readable error message |
| **userMessage** | `string` | optional | Producer-marked user-facing refusal text, verbatim, in the request's locale: platform-composed text falls back to the workspace default locale, then `en`; an app-authored refusal falls back to its declared wording. Present exactly when the producer opted in at throw time; consumers render it to end users as received and keep their generic substitution for anything unmarked. Status-agnostic; never replaces `message`. |
Expand Down Expand Up @@ -225,6 +225,7 @@ const result = ApiErrorSchema.parse(data);
* `FLOW_INPUT_SCHEMA_INVALID`
* `FLOW_NO_START_NODE`
* `FORBIDDEN`
* `FORM_ADDRESS_TAKEN`
* `FORM_NOT_FOUND`
* `FORM_RESOLVE_FAILED`
* `HOOK_ABORTED`
Expand Down
1 change: 1 addition & 0 deletions content/docs/references/api/error-code-ledger.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ const result = ErrorCode.parse(data);
* `FLOW_INPUT_SCHEMA_INVALID`
* `FLOW_NO_START_NODE`
* `FORBIDDEN`
* `FORM_ADDRESS_TAKEN`
* `FORM_NOT_FOUND`
* `FORM_RESOLVE_FAILED`
* `HOOK_ABORTED`
Expand Down
5 changes: 3 additions & 2 deletions content/docs/references/api/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ Metadata query with filtering, sorting, and pagination

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **types** | `Enum<'object' \| 'object_extension' \| 'field' \| 'hook' \| 'seed' \| 'mapping' \| 'picklist' \| 'view' \| 'page' \| 'dashboard' \| 'app' \| 'action' \| 'report' \| 'dataset' \| 'flow' \| 'job' \| 'datasource' \| 'external_catalog' \| 'translation' \| 'api' \| 'email_template' \| 'doc' \| 'book' \| 'permission' \| 'position' \| 'capability' \| 'sharing_rule' \| 'queue' \| 'assignment_rule' \| 'agent' \| 'tool' \| 'skill' \| 'ai_context'>[]` | optional | Filter by metadata types |
| **types** | `Enum<'object' \| 'object_extension' \| 'field' \| 'hook' \| 'seed' \| 'mapping' \| 'picklist' \| 'view' \| 'form' \| 'page' \| 'dashboard' \| 'app' \| 'action' \| 'report' \| 'dataset' \| 'flow' \| 'job' \| 'datasource' \| 'external_catalog' \| 'translation' \| 'api' \| 'email_template' \| 'doc' \| 'book' \| 'permission' \| 'position' \| 'capability' \| 'sharing_rule' \| 'queue' \| 'assignment_rule' \| 'agent' \| 'tool' \| 'skill' \| 'ai_context'>[]` | optional | Filter by metadata types |
| **namespaces** | `string[]` | optional | Filter by namespaces |
| **packageId** | `string` | optional | Filter by owning package |
| **search** | `string` | optional | Full-text search query |
Expand Down Expand Up @@ -709,7 +709,7 @@ Metadata query with filtering, sorting, and pagination

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'object' \| 'object_extension' \| 'field' \| 'hook' \| 'seed' \| 'mapping' \| 'picklist' \| 'view' \| 'page' \| 'dashboard' \| 'app' \| 'action' \| 'report' \| 'dataset' \| … +19 more>` | ✅ | Metadata type |
| **type** | `Enum<'object' \| 'object_extension' \| 'field' \| 'hook' \| 'seed' \| 'mapping' \| 'picklist' \| 'view' \| 'form' \| 'page' \| 'dashboard' \| 'app' \| 'action' \| 'report' \| … +20 more>` | ✅ | Metadata type |
| **name** | `string` | ✅ | Item name (snake_case) |
| **data** | `Record<string, any>` | ✅ | Metadata payload |
| **namespace** | `string` | optional | Optional namespace |
Expand All @@ -724,6 +724,7 @@ Metadata query with filtering, sorting, and pagination
* `mapping`
* `picklist`
* `view`
* `form`
* `page`
* `dashboard`
* `app`
Expand Down
2 changes: 2 additions & 0 deletions content/docs/references/api/package-api-assembled.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Installed package row whose manifest is the assembled package body
| **apps** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; icon?: string; … }[]` | optional | Applications |
| **views** | `{ name?: string; label?: string \| Record<string, string>; object?: string; list?: object; … }[]` | optional | List Views |
| **viewItems** | `never` | optional | [MACHINE-ASSEMBLED] Non-container view artifacts of a runtime-assembled manifest (standalone ViewItems, flattened overlays) — written by package export and artifact factories, refused in authored stack sources. |
| **forms** | `{ name: string; object: string; label?: string \| Record<string, string>; type?: Enum<'simple' \| 'tabbed' \| 'wizard'>; … }[]` | optional | Data-entry forms, one object each (ADR-0159): `defineForm` items named `OBJECT.KEY` |
| **pages** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; icon?: string; … }[]` | optional | Custom Pages |
| **dashboards** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; header?: object; … }[]` | optional | Dashboards |
| **reports** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; type?: Enum<'tabular' \| 'summary' \| 'matrix' \| 'joined'>; … }[]` | optional | Analytics Reports |
Expand Down Expand Up @@ -369,6 +370,7 @@ This schema accepts one of the following structures:
| **apps** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; icon?: string; … }[]` | optional | Applications |
| **views** | `{ name?: string; label?: string \| Record<string, string>; object?: string; list?: object; … }[]` | optional | List Views |
| **viewItems** | `never` | optional | [MACHINE-ASSEMBLED] Non-container view artifacts of a runtime-assembled manifest (standalone ViewItems, flattened overlays) — written by package export and artifact factories, refused in authored stack sources. |
| **forms** | `{ name: string; object: string; label?: string \| Record<string, string>; type?: Enum<'simple' \| 'tabbed' \| 'wizard'>; … }[]` | optional | Data-entry forms, one object each (ADR-0159): `defineForm` items named `OBJECT.KEY` |
| **pages** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; icon?: string; … }[]` | optional | Custom Pages |
| **dashboards** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; header?: object; … }[]` | optional | Dashboards |
| **reports** | `{ name: string; label: string \| Record<string, string>; description?: string \| Record<string, string>; type?: Enum<'tabular' \| 'summary' \| 'matrix' \| 'joined'>; … }[]` | optional | Analytics Reports |
Expand Down
1 change: 1 addition & 0 deletions content/docs/references/api/protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
| **datasets** | `Record<string, { label?: string; description?: string; dimensions?: Record<string, object>; measures?: Record<string, object> }>` | optional | Analytics dataset translations keyed by dataset name |
| **reports** | `Record<string, { label?: string; description?: string; blocks?: Record<string, object> }>` | optional | Report translations keyed by report name |
| **pages** | `Record<string, { label?: string; description?: string; title?: string; subtitle?: string; … }>` | optional | Page translations keyed by page name |
| **forms** | `Record<string, { label?: string; description?: string; title?: string; submitBehavior?: object; … }>` | optional | Form translations keyed by form name (ADR-0159 D8) |
| **flows** | `Record<string, { label?: string; successMessage?: string; errorMessage?: string; screens?: Record<string, object>; … }>` | optional | Screen-flow translations keyed by flow name |
| **hooks** | `Record<string, { refusals?: Record<string, object>; texts?: Record<string, object> }>` | optional | Hook translations keyed by hook name |
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
Expand Down
Loading
Loading