Skip to content

Commit bdc8319

Browse files
committed
Merge origin/main into claude/project-thread-nr5783
2 parents ba2bb37 + 3d73c1d commit bdc8319

48 files changed

Lines changed: 2291 additions & 220 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.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-data carries the metadata-authoring judgment the hosted build agent learned — booleans, people fields, dynamic defaults, process modelling, roll-up qualifiers, seed values, labels, sharing posture
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Card 1 of the cloud#3659 ruling A split: one source of metadata-authoring knowledge for every build channel. This is the `objectstack-data` port — the judgment the schema cannot express and the published skill did not yet state. `SKILL.md`: a yes/no flag is `{ type: 'boolean', defaultValue: false }` and never `required` ("must be accepted" is a validation rule); a person on the record is `type: 'user'`, optional unless asked; a dynamic default resolves on save and is described as such; record status is a `select` with a `state_machine`, never a status table; approvals, routing and audit trails are not objects; the record owner is the platform `owner_id`, never a hand-added lookup, and `ownership: 'none'` is only for catalogs and junctions; the `sharingModel` posture is chosen from the request; a `state_machine` declares `initialStates` whenever the status has a real start. `rules/relationships.md`: pick the roll-up function from the words, put every qualifier in `summaryOperations.filter` (dropped, it is a plausible wrong total), a rate is a formula over a working summary, and the recompute runs only on a child write — a summary declared after its rows exist is backfilled by `os migrate summary-nulls --apply`; its examples take the posture the paragraph teaches. `rules/validation.md`: the canonical `state_machine` example declares `initialStates`. `rules/naming.md`: labels follow the user's language. `references/seeds.md`: seed values may be fictional, never malformed — `os validate` / `os build` refuse a malformed one first. Eight eval cases pin the teachings (objects-fields-relationships 10–14, hooks-security-seeds-datasources 14–16).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the platform skill names the installation-wide uniques stop on a self-hosted `os deploy`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`objectstack-platform`'s operations reference: a `use-runtime` target's install refusal now also covers the installation-wide `unique` constraints stop, with its two ways on: rerun with `--confirm-global-uniques` when those constraints are meant platform-wide, else set them `unique: 'organization'`. `os deploy` already accepts the flag; this release only teaches it. Two logger and metrics restatements whose home is `references/plugin-development.md` are cut.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/cli': patch
4+
---
5+
6+
feat(spec): a restriction profile lists the approval pair through its own node vocabulary, and `allowSandboxedJs` splits sandboxed JavaScript bodies off `allowCode`
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: added
10+
Skills-docs: none — the profile is data a target environment publishes, not a key an app author writes into a stack; authors meet it through `os validate --target`, whose refusals name each rule.
11+
12+
`RestrictionProfileSchema` has not shipped in a release yet, so both changes below land inside the same release as the schema itself.
13+
14+
- **`RestrictionProfileNodeType`** (new export, `@objectstack/spec/system`): the node types a profile's `allowedFlowNodeTypes` can list. It is derived from two spec declarations: every `FlowNodeAction` id, plus the plugin node types whose contracts the spec declares, `approval` and `approval_revise`. `FlowNodeAction` itself does not change. A hosted plan that runs the approvals plugin can now list the pair, and one that does not can leave it out. Before this change the pair could not be listed, so `os validate --target` judged it under `allowCode` and refused it.
15+
- **`allowSandboxedJs`** (new, required boolean): whether a sandboxed JavaScript body (`language: 'js'`) is allowed on a hook, an action or a background job. `allowCode` now covers only in-process code: a hook or job with no `body` (so its `handler` runs), named `functions`, code plugins, the `script` flow node and the other code keys. An expression body (`language: 'expression'`) falls under neither key. A kernel that binds sandboxed bodies but loads no runtime module publishes `allowCode: false, allowSandboxedJs: true`. Every profile must now carry the key: add `"allowSandboxedJs": true` or `false` to a profile written against the earlier shape.
16+
17+
`os validate --target` follows both changes. A hook or job is judged by the body it runs, because a `body` wins over `handler` exactly as it does at bind. Sandboxed JS action bodies were never read before; they are now judged too, both top-level `actions` and those embedded on `objects[].actions`. Under `allowScheduledAutomation: false` a job is refused by that rule alone. The approval pair is judged by `allowedFlowNodeTypes`, and only a node type outside the profile vocabulary still falls to `allowCode`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `FlowSchema` example guards its nullable `amount` comparisons
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `FlowSchema` doc-comment example branched on `record.amount < 500` and `record.amount >= 500` with no null test. Bound to an object whose `amount` is optional, as an author copying it would bind it, the publish-time null-guard rule refuses both edges: on a record-triggered flow a null `amount` aborts the condition and the run fails. The example now binds its start node to `order` (`record-after-update`), so the rule judges it as written; the auto-approve edge reads `record.amount != null && record.amount < 500`, and the review edge is the default edge (`isDefault: true`), so every other order, one with no amount included, goes to review.
11+
12+
The spec change is doc-comment text only: no schema shape changes, and no accept set moves.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): the organization-ownership ceremony's not-null step runs again on a resumed apply, so a table it left nullable receives NOT NULL once that is possible
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`os migrate organization-ownership --apply` recorded its not-null step as done even when it left tables nullable: tables the booted composition declared no object for (`notDeclared`), and tables still holding a NULL row the operator had to resolve by hand. A later apply then read the checkpoint and skipped the step. Re-running under a composition that declares those tables, or after fixing the rows (apply, fix rows, plan, apply), certified the database with `organization_id` still nullable on them, although the step's own advice said such a re-run applies it.
11+
12+
On a resumed apply that has a schema door, the step now runs again. A table that is declared and has no NULL row receives NOT NULL. A column that is already NOT NULL is answered `already-not-null`, read from the database's catalog, and is never rebuilt. A re-run with nothing left to tighten stays `checkpointed`, exactly as before. A re-run whose NOT NULL fails blocks the run and is no longer recorded as done, the same as on a first run. A first run is unchanged.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime): the environment-membership check judges the principal the request resolved
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On a multi-environment host, the dispatcher refuses a caller who is not a member of the environment a scoped route resolves to (`403 PROJECT_MEMBERSHIP_REQUIRED`). That check now judges the principal the request resolved, whichever credential admitted it: a principal admitted by an OAuth access token on `/mcp` or by an API key is judged as that token's user or that key's owner, in the organization its resolution vetted, including when a session cookie for another user is sent beside it. A principal admitted by a session cookie is judged as before. Hosts without environment scoping, and hosts that turn the check off (`api.enforceProjectMembership: false`), are unchanged.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/rest': patch
3+
---
4+
5+
fix(rest): a door whose environment's security service cannot be resolved refuses rather than proceeds
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The REST server's security resolver keeps two answers apart, by the service registry's own "never registered" brand:
11+
12+
- **Not registered** — no `plugin-security`, or a single kernel without a security service — is a deployment with no permission posture (ADR-0106 D6 tier 1). Every door answers it exactly as before, the `/security` doors' `501 NOT_IMPLEMENTED` included.
13+
- **Registered but unresolvable** — a registered security service whose factory throws, or an environment kernel that cannot be acquired at the security step — is an unhealthy security service (ADR-0106 D6 tier 3). The request answers `503 SERVICE_UNAVAILABLE`, the same answer an unreadable authorization input gives everywhere else, and nothing is served.
14+
15+
These doors ask this resolver:
16+
17+
- the data export; the import template, at its gate and at its column projection; every object-schema read under `/meta` while object-schema masking is on (the default); and the record field-access door — each answers the `503`;
18+
- the record page, whose access-explanation and field-access parts each carry the `503` as their own part refusal, while the page still answers with the record and every other part;
19+
- the `/security` doors — the access explanation, the caller's delegable scope, a user's effective access, and the suggested audience bindings with their confirm, dismiss and reopen — each answers the `503` in its family's nested envelope. A caller context whose authorization store cannot be read answers the same `503` at these doors.
20+
21+
On a multi-environment host, an operator who sees this `503` for one environment restores that environment's security service; the other environments are unaffected.

‎.claude/agents/os-dev.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ model: opus
352352
- 同 PR 改,正文点名裁决 id,落地欠契约复审档记录;⛔ 永不自行翻转裁决,与之相左仍停手。
353353
- 两种读法通向两种架构时同此;⛔ 不写投机代码。
354354
- 返回 `status: "needs_decision"`,每个问题带选项、真实代价与工作量、推荐,写进 `open_questions`。
355-
- 派发词标只读读数 ⇒ 不建闭包、不跑测试、不开 PR;报 `status: "reading"`,读数贴决策卡。
355+
- 派发词标只读读数 ⇒ 不 commit、不开 PR,`status: "reading"` 贴决策卡;要实测才建闭包跑测。
356356
- 框架唯一副本在 pm-dispatch SKILL.md 〈升级与决策〉;派发词逐字粘贴,dev ⛔ 不留副本。
357357
- 每个方案逐轴分析,推荐也按那些轴给理由;派发词没带,停下向 PM 索取,⛔ 不自拟一套轴。
358358
- `main` 碎了、依赖未合并、CI 基础设施故障 ⇒ 报 `blocked` 附证据,重试到排除你的改动。

‎content/docs/references/index.mdx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Protocol reference — every schema by module
33
navTitle: Protocol Reference
4-
description: Every schema published by @objectstack/spec — 1636 schemas across 14 protocol modules
4+
description: Every schema published by @objectstack/spec — 1637 schemas across 14 protocol modules
55
---
66

77
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
@@ -32,9 +32,9 @@ counts are sums of the rows they head. Regenerate with
3232
| [Security Protocol](/docs/references/security) | 6 | 37 | Permission sets, row-level security, sharing rules, tenancy posture. |
3333
| [Shared Protocol](/docs/references/shared) | 10 | 31 | Primitives used across every protocol — identifiers, HTTP, expressions, error maps, enums. |
3434
| [Studio Protocol](/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. |
35-
| [System Protocol](/docs/references/system) | 40 | 296 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
35+
| [System Protocol](/docs/references/system) | 40 | 297 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
3636
| [UI Protocol](/docs/references/ui) | 16 | 175 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
37-
| **Total** | **213** | **1636** | 14 protocol modules |
37+
| **Total** | **213** | **1637** | 14 protocol modules |
3838

3939
---
4040

@@ -329,7 +329,7 @@ Studio designer metadata — the authoring surfaces for the protocols above.
329329

330330
## System Protocol
331331

332-
**Source:** `packages/spec/src/system/` · **Import:** `@objectstack/spec/system` · **40 pages, 296 schemas**
332+
**Source:** `packages/spec/src/system/` · **Import:** `@objectstack/spec/system` · **40 pages, 297 schemas**
333333

334334
The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance.
335335

@@ -363,7 +363,7 @@ The runtime environment — logging, jobs, cache, metrics, notifications, i18n a
363363
| [`push-config.zod.ts`](/docs/references/system/push-config) | `ApnsTransportConfig`, `FcmTransportConfig`, `PushDirectTransportConfig`, `PushRelayTransportConfig`, `PushServiceConfig`, `PushVendor` |
364364
| [`push-device.zod.ts`](/docs/references/system/push-device) | `UserDevice` |
365365
| [`registry-config.zod.ts`](/docs/references/system/registry-config) | `RegistryConfig`, `RegistrySyncPolicy`, `RegistryUpstream` |
366-
| [`restriction-profile.zod.ts`](/docs/references/system/restriction-profile) | `RestrictionProfile` |
366+
| [`restriction-profile.zod.ts`](/docs/references/system/restriction-profile) | `RestrictionProfile`, `RestrictionProfileNodeType` |
367367
| [`search-engine.zod.ts`](/docs/references/system/search-engine) | `AnalyzerConfig`, `FacetConfig`, `SearchConfig`, `SearchIndexConfig`, `SearchProvider` |
368368
| [`security-context.zod.ts`](/docs/references/system/security-context) | `ComplianceAuditRequirement`, `ComplianceEncryptionRequirement`, `ComplianceFramework`, `DataClassification`, `DataClassificationPolicy`, `MaskingVisibilityRule`, `SecurityContextConfig`, `SecurityEventCorrelation` |
369369
| [`settings-client.zod.ts`](/docs/references/system/settings-client) | `SettingsChangeEvent` |

‎content/docs/references/system/restriction-profile.mdx‎

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Restriction Profile — System Protocol
33
navTitle: Restriction Profile
4-
description: "Restriction Profile schemas of the ObjectStack System Protocol: RestrictionProfile — each property with its type, default and a TypeScript example."
4+
description: "Restriction Profile schemas of the ObjectStack System Protocol: RestrictionProfile and 1 more — each property with its type, default and a TypeScript example."
55
---
66

77
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
@@ -13,8 +13,8 @@ description: "Restriction Profile schemas of the ObjectStack System Protocol: Re
1313
## TypeScript Usage
1414

1515
```typescript
16-
import { RestrictionProfileSchema } from '@objectstack/spec/system';
17-
import type { RestrictionProfile } from '@objectstack/spec/system';
16+
import { RestrictionProfileSchema, RestrictionProfileNodeType } from '@objectstack/spec/system';
17+
import type { RestrictionProfile, RestrictionProfileNodeType } from '@objectstack/spec/system';
1818

1919
// Validate data
2020
const result = RestrictionProfileSchema.parse(data);
@@ -30,9 +30,10 @@ What a target environment does not let metadata do, published by that environmen
3030

3131
| Property | Type | Required | Description |
3232
| :--- | :--- | :--- | :--- |
33-
| **allowCode** | `boolean` | ✅ | Whether metadata that carries code is allowed (object lifecycle hooks, named handler functions, code plugins) |
33+
| **allowCode** | `boolean` | ✅ | Whether metadata that carries in-process code is allowed (handler-form hooks and jobs, named handler functions, code plugins, the script flow node); sandboxed JS bodies are governed by allowSandboxedJs |
34+
| **allowSandboxedJs** | `boolean` | ✅ | Whether a sandboxed JavaScript body (language 'js') is allowed on hooks, actions and jobs; expression bodies are governed by neither this key nor allowCode |
3435
| **allowScheduledAutomation** | `boolean` | ✅ | Whether scheduled automation is allowed (flows of type 'schedule' and scheduled background jobs) |
35-
| **allowedFlowNodeTypes** | `Enum<'start' \| 'end' \| 'decision' \| 'assignment' \| 'loop' \| 'create_record' \| 'update_record' \| 'delete_record' \| 'get_record' \| 'http' \| 'notify' \| 'save_notice' \| 'script' \| 'screen' \| 'wait' \| 'subflow' \| 'map' \| 'connector_action' \| 'parallel_gateway' \| 'join_gateway' \| 'boundary_event'>[]` | ✅ | Built-in flow node types a flow may use (FlowNodeAction ids); a built-in type not listed is forbidden |
36+
| **allowedFlowNodeTypes** | `Enum<'start' \| 'end' \| 'decision' \| 'assignment' \| 'loop' \| 'create_record' \| 'update_record' \| 'delete_record' \| 'get_record' \| 'http' \| 'notify' \| 'save_notice' \| 'script' \| 'screen' \| 'wait' \| 'subflow' \| 'map' \| 'connector_action' \| 'parallel_gateway' \| 'join_gateway' \| 'boundary_event' \| 'approval' \| 'approval_revise'>[]` | ✅ | Flow node types a flow may use (FlowNodeAction ids plus the spec-declared plugin node types approval and approval_revise); a type of that vocabulary not listed is forbidden |
3637
| **versions** | `{ spec: string; skills: string }` | ✅ | The @objectstack/spec and @objectstack/skills versions the environment runs |
3738

3839
### Nested Shape: `RestrictionProfile.versions`
@@ -45,3 +46,36 @@ What a target environment does not let metadata do, published by that environmen
4546

4647
---
4748

49+
## RestrictionProfileNodeType
50+
51+
Flow node types a restriction profile can list: every FlowNodeAction id plus the spec-declared plugin node types approval and approval_revise
52+
53+
### Allowed Values
54+
55+
* `start`
56+
* `end`
57+
* `decision`
58+
* `assignment`
59+
* `loop`
60+
* `create_record`
61+
* `update_record`
62+
* `delete_record`
63+
* `get_record`
64+
* `http`
65+
* `notify`
66+
* `save_notice`
67+
* `script`
68+
* `screen`
69+
* `wait`
70+
* `subflow`
71+
* `map`
72+
* `connector_action`
73+
* `parallel_gateway`
74+
* `join_gateway`
75+
* `boundary_event`
76+
* `approval`
77+
* `approval_revise`
78+
79+
80+
---
81+

0 commit comments

Comments
 (0)