Skip to content

Commit 58a07ee

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-pp8ksi
2 parents e739853 + 9598405 commit 58a07ee

48 files changed

Lines changed: 2500 additions & 2618 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/25610-notify-email-field-recipient.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A `notify` node's `recipients` takes a fourth form, as the whole value: `{ email
2222
- The form is the whole `recipients` value, never a list entry.
2323
- `@objectstack/lint` refuses, at `os validate`, `os lint`, `os build` and the runtime publish door for a flow, an email-field recipient whose field the trigger object does not declare (`notify-email-field-unknown`), one whose field is not `email`-typed (`notify-email-field-not-email`), and one in a flow that hands its run no record of a known object — a schedule, an inbound api call, a record trigger that names no object (`notify-email-field-no-trigger-record`). A trigger object another package declares is not judged.
2424

25-
This change is the protocol half. Delivery — resolving the field to an address, the outbound mail configuration, the per-address rate limit and the messaging-log entry — is the messaging service's half and lands separately; until it does, a run that reaches such a node fails at the node.
25+
This change is the protocol half. Delivery — resolving the field to an address, the outbound mail configuration, the per-address rate limit and the messaging-log entry — ships in the same release in `@objectstack/service-automation`.
2626

2727
Clause-②: yes (widening)
2828

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): Browse Marketplace says the catalog could not be reached when the runtime cannot reach it, instead of "the catalog answered with an error (HTTP 502)"
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **`@object-ui/app-shell`**: the runtime's marketplace proxy answers `502 MARKETPLACE_PROXY_FAILED` only when its own fetch to the catalog throws. The load-error panel picked its class line by status alone, so that answer read "The marketplace catalog answered with an error (HTTP 502)", with the raw transport text `fetch failed` in full view below it. The panel now reads the error code as well: that code, or no answer at all, reads "The marketplace catalog could not be reached.", and the raw text sits behind a **More** / **Less** disclosure with a copy button. A failure the catalog did answer, including a 502, 503 or 504 relayed from upstream, still names its HTTP status and shows the server's own text. The online hint is unchanged.
11+
12+
What to do: nothing.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/fields': patch
3+
---
4+
5+
fix(fields): a `user` field's person object is always `sys_user` — the user cell and the person picker no longer read an authored `reference`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A `user` field's target is a constant of its type: `@objectstack/spec` refuses a `user` field whose `reference` names any object but `sys_user`, and `referenceTargetOf` resolves every `user` field to `sys_user` whatever the field carries. The console now agrees with it in two places:
11+
12+
- **`UserCellRenderer`** (read-only cell): the field-level read gate on the person's name and avatar is keyed by `sys_user`. A stored object saved before the spec refused a foreign `reference` (for example `reference: 'crm_member'`) used to gate the cell by that object's policy; it is now gated by the `sys_user` policy, the object the runtime expands the field into.
13+
- **`UserField`** (person picker): the picker targets `sys_user` even when the field carries a foreign `reference`, so it offers users, matching what the runtime stores and resolves.
14+
15+
What to do: nothing for a spec-valid `user` field (no `reference`, or `reference: 'sys_user'`). A field that links to another object is a `lookup`.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/service-storage': patch
3+
---
4+
5+
fix(storage)!: a record write naming a file its caller may not read is refused at the field
6+
7+
A record write that names a file its caller may not read is now refused at that field, instead of saving the id as written. The answer is one `400 VALIDATION_FAILED` whose `fields[]` names each such field with the ADR-0114 code `invalid_value`, the same envelope the public form door gives an anonymous submission that carries a file. It names the field only. An id that names no file of the acting organization gets the same answer, so the write cannot tell the two apart. Nothing is claimed, copied or written. System writes and writes with no caller context reference files as before, and an authorization-store outage still fails the write with its declared envelope.
8+
9+
A file governed by a record's rule also gets the record-governed link lifetime at the download door.
10+
11+
Clause-②: no (narrowing) — a record write that names a file its caller may not read, or an id no file of the organization has, was saved and is now refused. Nothing that was refused becomes accepted.
12+
13+
Metadata-protocol: none (a write-time refusal on file fields; nothing a metadata author writes changes)
14+
15+
<!-- adr-0087: not-required (no-migration-prescription) No metadata author's surface moves: no spec key or authorable spelling is added, removed, renamed or re-shaped, and no exported declaration is removed or narrowed, so there is nothing for `objectstack migrate meta` to rewrite. What changes is which record writes the file-reference lifecycle accepts: a write naming a file its caller may not read is refused at the field. The remedy is naming a file the caller may read, or leaving the field empty, never a rewrite of a package source or a stored row. The other categories are closed on facts: the package publishes (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); and nothing exported is removed or narrowed (not runtime-interface-only, type-surface-only or runtime-export-retired). -->
16+
17+
**BREAKING** for a caller that writes a file id it may not read, shipped as `patch` because the metadata protocol does not move.
18+
19+
- **Before.** The write saved, and the field kept an id its readers could not use.
20+
- **Now.** The write is refused with `400 VALIDATION_FAILED`, naming the field with `invalid_value`.
21+
- **Fix.** Name a file the caller may read (upload it, or choose one they can open), or leave the field empty.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix: a sandboxed hook's or action's business refusal is logged once, at info, without a stack
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
When a sandboxed hook or action body refuses on purpose, for example a state-machine hook answered as `422 INVALID_STATE`, the server log used to get two `ERROR [BodyRunner]` lines with full stacks: one at the hook and one again at the action that triggered it. An operator watching for errors could not tell a refused click from a crashed hook.
11+
12+
Now a throw that the HTTP doors answer in the 4xx band writes one `info` line, `[BodyRunner] sandboxed hook refused` (or `action refused`), naming the hook or action, its declared `code` and the status, with no stack. The action does not repeat a refusal its hook already logged. A throw that becomes a 5xx (a crash, a denied capability, a declared 5xx) still logs `error` with its stack, at both the hook and the action as before.
13+
14+
The refusal-or-fault split is read from the same error table the HTTP doors answer with (`mapDataError`), so the log level follows the status the caller saw. The HTTP status, body and message of every refusal are unchanged, and every throw is still rethrown.

‎.github/workflows/lint.yml‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -984,29 +984,6 @@ jobs:
984984
continue-on-error: true
985985
run: pnpm check:widget-option-census
986986

987-
# The sdui-parser LOCKSTEP invariant (#12719 / #13150). Two copies of the
988-
# constrained-JSX parser exist: objectui's runs in the RENDERER, this one
989-
# runs in the SAVE GATE, and #12719 states that they must byte-agree on
990-
# the accepted grammar and on the diagnostic codes — an invariant that had
991-
# been enforced by NOTHING through three manual ports, two of which landed
992-
# only because someone happened to file a card naming the drift.
993-
#
994-
# Compared against a VENDORED RECORD of objectui's side, so this step
995-
# needs no network, no build and no objectui checkout. Read the gate's
996-
# header for what that buys and what it costs: it sees this copy moving
997-
# away from the recorded objectui state; it does NOT see objectui moving
998-
# afterwards, and only a `.objectui-sha` bump — the moment a divergence
999-
# starts SHIPPING — brings that direction back into view.
1000-
#
1001-
# Unfiltered on purpose. The record lives under packages/sdui-parser/, the
1002-
# pin is a root dotfile, and this workflow declares no paths: filtering it
1003-
# to the parser subtree would go dormant on exactly the PR that moves the
1004-
# pin. Cost is one TypeScript parse of seven small files, ~0.4 s.
1005-
- name: sdui-parser stays in lockstep with objectui's copy
1006-
id: sdui-parser-stays-in-lockstep-with-objectui
1007-
continue-on-error: true
1008-
run: pnpm check:sdui-lockstep
1009-
1010987
# The checked-in SDUI public-tier manifest (#12924, ruled 2026-08-29: wire
1011988
# it). `resolveSduiManifest()` degrades to parse-only SILENTLY when the
1012989
# repo-root `sdui.manifest.json` is absent or unreadable, so nothing in

‎AGENTS.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ localStorage / auth gotchas.
258258
When a cloud decision's **mechanism half** governs open code here, this repo carries its own ADR — own number, a
259259
`## Provenance` section naming the cloud record and its date, the commercial half left in cloud — and the cloud
260260
record gains a one-line pointer. Files never move between registries and numbers are never reassigned.
261-
14. **⛔ A governed surface lands only the way its tier allows — Tier H by the maintainer's hand or by an authorized
262-
approval, Tier S by the owning seat on a contract-tier review of record; before that record no AI seat merges,
263-
queues, or arms auto-merge on a PR whose diff touches one.** The governed surfaces are `docs/adr/**`,
261+
14. **⛔ A governed surface lands only the way its tier allows — Tier H by the maintainer's hand (merge or enqueue)
262+
or an authorized approval, Tier S by the owning seat on a contract-tier review of record; before that record no AI
263+
seat merges, queues, or arms auto-merge on a PR whose diff touches one.** The governed surfaces are `docs/adr/**`,
264264
`docs/NORTH-STAR.md`, `.claude/**` (agents, hooks and settings — not only skills), `skills/**`, `AGENTS.md`,
265265
`CLAUDE.md` and `.github/workflows/**`, and under `ui/` `ui/docs/adr/**`, `ui/.claude/**`, `ui/skills/**`,
266266
`ui/AGENTS.md`, `ui/CLAUDE.md` and `ui/.github/workflows/**`, all Tier H. The register is `GOVERNED_SURFACES` in
@@ -284,7 +284,7 @@ localStorage / auth gotchas.
284284
paths are register rows the queue leg regenerates byte-exact clears with zero approvals — an uncertified
285285
recompute, drift or a hand-authored sibling keeps it governed. ⛔ **No agent seat submits an approving review on a
286286
governed-surface PR, under any account** — an authorized account is agent-operated too; "CI is green" carries no
287-
information about a governance change.
287+
information about a governance change. An authorized account's enqueue is a review record too: ⛔ never a seat's.
288288

289289
**Already armed or queued when you read this?** Disable auto-merge AND convert it back to **draft**, which disarms
290290
an unqueued PR; no seat act, those two included, is measured to dequeue one (`platform-readings.md`, queue
@@ -513,8 +513,8 @@ Even inside your own worktree, operate defensively:
513513
so re-read it rather than recalling it); (b) the **Version Packages** PR, or any PR whose merge performs a
514514
release (**Prime Directive #15**); (c) a PR whose **changed lines exceed 3,000** (`additions + deletions`,
515515
generated files included) — it lands the way a Tier H surface does: an authorized APPROVED review and then
516-
the owning seat, or a human merge. Read the PR's file list (`get_files`), **its author and its size** before
517-
you arm anything.
516+
the owning seat, or the maintainer's merge or enqueue. Read the PR's file list (`get_files`), **its author and
517+
its size** before you arm anything.
518518

519519
**Green means the gate-carrying jobs' `conclusion` is `success`** — not "no failure
520520
yet"; `in_progress` is not a pass. Arming a red PR does not queue it, it hides it:

‎CONTRIBUTING.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ The README's [Hack on the framework](./README.md#hack-on-the-framework) section
6363
has the commands for building the Console and running an example app with `pnpm dev`;
6464
the next section says what each one costs.
6565

66+
`pnpm dev` listens on port 3000 and automatically shifts to the next free port
67+
when 3000 is busy; pin an explicit port with `OS_PORT=3000 pnpm dev` (`PORT` is
68+
the legacy alias). The Console's own dev server (`ui/apps/console`, Vite on
69+
:5180) proxies `/api` to `DEV_PROXY_TARGET`, default `http://localhost:3000`, so
70+
when the backend has moved off 3000, point `DEV_PROXY_TARGET` at the port it
71+
printed.
72+
6673
## Build and Test Cost
6774

6875
`pnpm console:build` builds the Console from its source in this workspace

‎content/docs/getting-started/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Before you start, make sure you have the following installed:
166166
|:---|:---|:---|
167167
| **Node.js** | 22.0.0+ | `node --version` |
168168

169-
That's everything the standard path needs — `npx create-objectstack my-app`
169+
That's everything the standard path needs — `npm create objectstack@latest my-app`
170170
scaffolds a project with its own TypeScript toolchain and npm scripts.
171171

172172
<Callout type="warn">

‎content/docs/permissions/access-recipes.mdx‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Pick the layer that matches the requirement:
1818
|---|---|---|
1919
| Can read/create/edit/delete an object type | Object CRUD | permission-set `objects.{allowCreate/Read/Edit/Delete}` |
2020
| Can see / edit a specific field | Field-level security (FLS) | permission-set `fields`, or field `requiredPermissions` |
21+
| Can no longer edit a field once a record reaches a stage, for some positions only | Row-conditioned FLS | permission-set `fields` entry with `when` ([recipe](#data-lock-fields-for-a-position-once-a-record-reaches-a-stage)) |
2122
| Which *rows* a user sees | Row-level security (RLS) | permission-set `rowLevelSecurity` (CEL `using` / depth `readScope`) |
2223
| A functional capability (export, approve, manage) | Capability | `systemPermissions` ↔ resource `requiredPermissions` |
2324
| Can open an app / nav entry / page | Surface access | `App.requiredPermissions`, `tabPermissions`, nav gating |
@@ -40,6 +41,51 @@ definePermissionSet({
4041
- Grants combine **most-permissively** across a user's sets; the tenant-isolation policy `AND`s on top; the superuser bypass (`viewAllRecords` / `modifyAllRecords`) short-circuits RLS where the object's posture allows it (ADR-0066).
4142
- For genuinely sensitive objects, set `access: { default: 'private' }` so they are **not** covered by blanket wildcard grants — access needs an explicit grant.
4243

44+
### Data: lock fields for a position once a record reaches a stage
45+
46+
> Finance may edit a contract while it is a draft, but once it is approved the legal terms are frozen for finance. Legal still edits them.
47+
48+
Every business app meets this shape: a contract's legal terms after approval, an order's amount after shipping, an invoice after posting, a purchase order's supplier after approval. The answer is a field permission with a **row condition**, `when`, on the permission set that should lose the edit.
49+
50+
**In the permission-set editor** (Setup → Access Control → Permission Sets, then open the set):
51+
52+
1. Expand the object (`clm_contract`) to show its field rows.
53+
2. On each field row to lock (`governing_law`, `liability_cap`), keep **Read** on and **Edit** off.
54+
3. In the row's **When (edit)** column, choose **Add condition** and write the stage condition: `status in ["approved", "signing", "active"]`. The editor lints it like a row-level security clause, and a condition the publish gate would refuse holds the save.
55+
56+
**The same entries as metadata:**
57+
58+
{/* os:check */}
59+
```ts
60+
import { definePermissionSet } from '@objectstack/spec';
61+
62+
definePermissionSet({
63+
name: 'finance',
64+
objects: { clm_contract: { allowRead: true, allowEdit: true } },
65+
fields: {
66+
// Locked for finance from approval onward; a draft stays editable.
67+
'clm_contract.governing_law': { readable: true, editable: false, when: 'status in ["approved", "signing", "active"]' },
68+
'clm_contract.liability_cap': { readable: true, editable: false, when: 'status in ["approved", "signing", "active"]' },
69+
},
70+
});
71+
```
72+
73+
On a row the condition matches, the entry votes as declared (no edit). On every other row the entry is absent, as if the set had not named the field, so a draft stays editable under the object grant.
74+
75+
**How to choose:**
76+
77+
- The field must freeze for **everyone** at that stage → a [validation rule](/docs/data-modeling/validation) on the object. It refuses the write whoever sends it.
78+
- The field freezes depending on **who** is editing → a field permission with `when` on the sets that lose the edit, as above.
79+
80+
**Boundaries:**
81+
82+
- **Edit only, never read.** The condition narrows the edit vote; reads are judged row-blind. Keep `readable: true` on the entry: `readable: false` beside a `when` is refused at parse time.
83+
- **Same object only.** The condition names fields of the entry's own object (compared with a literal or a `current_user.*` value). A condition that reaches across a relation, or names a field the object lacks, is refused at authoring and publish.
84+
- **The record before the write.** On an update the condition reads the stored record, so a write cannot unlock itself by moving `status` back in the same request. On an insert it reads the record as sent.
85+
- **It locks, it does not grant.** Grants merge most-permissively: if the same user holds another set that grants the edit, that grant still wins and the field stays editable. Grant the edit only in the sets that should keep it. A subtractive deny layer is [not yet implemented](/docs/permissions/authorization#combination-semantics-the-fixed-order).
86+
87+
Full semantics, including how a write with no judgeable row is treated: [Row-conditioned edit locks](/docs/permissions/field-level-security#row-conditioned-edit-locks-when).
88+
4389
### Automation: the run-identity is the safety decision
4490

4591
Two separate questions:

0 commit comments

Comments
 (0)