Skip to content

Commit 645c951

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-f6p2x0
2 parents bc4e632 + 383c353 commit 645c951

47 files changed

Lines changed: 1792 additions & 291 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-settings': patch
4+
'@objectstack/objectql': patch
5+
---
6+
7+
feat(spec): a `map` settings specifier for keyed rows; the data lifecycle retention overrides, row quotas and per-class quota defaults use it, and both settings doors judge them
8+
9+
Clause-②: yes (widening) — `SpecifierType` gains a member; the save and env doors also start refusing malformed values for the three keys (a narrowing on values that never took effect, named in the PR's BREAKING note)
10+
Metadata-protocol: added — a package author can now declare a `map` specifier in a settings manifest (a new accepted value of `SpecifierType`)
11+
12+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is removed, renamed or re-shaped: `SpecifierType` gains `map` and `Specifier` gains the optional `keyColumn` and `columns`. The three lifecycle keys keep their stored shape, their env variable names and their cascade. What narrows is the set of values the settings doors accept for those three keys: a stored value is runtime state in `sys_setting` / `sys_platform_setting` and an `OS_LIFECYCLE_*` override is a deployment's environment, so there is nothing for a migration to rewrite, and every refused value is one the sweep never applied. -->
13+
14+
**New: the `map` specifier** (`@objectstack/spec`, ADR-0007 as amended 2026-11-08). A setting whose value is keyed rows declares `type: 'map'` with a `keyColumn` (its header) and `columns` (`{ name, label, kind }`, `kind` is `duration` or `positive_integer`). One value column stores `Record<key, value>`; several store `Record<key, { [column]: value }>`. The keys a map admits are served at run time by an option source the settings service registers for the key, never listed in the manifest. `json` stays for raw config.
15+
16+
**`lifecycle.retention_overrides`, `lifecycle.quotas` and `lifecycle.quota_defaults` are `map` specifiers** (`@objectstack/objectql`). Stored values, `OS_LIFECYCLE_*` names and the env, global, organization cascade are unchanged, and the sweep reads the same shapes. Their keys are served from the running system: the objects that declare a lifecycle class other than `record` for the first two, the lifecycle classes other than `record` for `quota_defaults`.
17+
18+
**BREAKING** accept-set narrowing at the settings doors (`@objectstack/service-settings`), for those three keys only.
19+
20+
- **Before.** `PUT /api/settings/lifecycle` and `OS_LIFECYCLE_*` accepted any object under them: a misspelt object (`sys_audit_logs`), a quota written as text (`"1e6"`) or zero, a window written as `30 days`, a column misspelt (`max_age`). Each was stored, answered "saved", and the sweep silently applied nothing for it.
21+
- **Now.** The save door refuses such a value with `400 SETTINGS_VALIDATION` and one field error for the key, which names the entry and the expected form: `invalid_option` for a key the running system does not have, `invalid_shape` for a cell that is not a duration such as `7y` or a whole number above 0, `unknown_field` for a property no column declares, `invalid_type` for a value that is not an object (JSON text included). The env door rejects such an override with one `error` line, and the key resolves from the next layer of the cascade. A value already stored is not judged until a save touches its key.
22+
- **Who moves.** Nobody whose values took effect. A script or a deployment that wrote one of the refused values was configuring nothing; the refusal now says so. Durations take `h`, `d`, `w` or `y` (`90d`, `7y`), quotas a whole number above 0, and keys are the object names (or classes) the refusal lists.
23+
24+
**The remedy.** Send keys the deployment has and cells in their column's form: `{ "quotas": { "sys_audit_log": 1000000 } }`, `{ "retention_overrides": { "sys_job_run": { "maxAge": "90d" } } }`; for an override, `OS_LIFECYCLE_QUOTAS='{"sys_audit_log":1000000}'`.
25+
26+
**The console.** Until its `map` control lands (a separate change), Setup → Data Lifecycle draws these three keys as an unsupported specifier type; env overrides and the API are unaffected.
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-automation carries the flow-authoring judgment the hosted build agent learned — option values in conditions and writes, a named hour with its time zone, who an approval-outcome cascade runs as
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Card 1 of the cloud#3659 ruling A split, the `objectstack-automation` port — the judgment the schema cannot express and the published skill did not yet state. `SKILL.md` § Valid-but-silently-wrong: a `select` is compared and written by its option `value`, never the label the request speaks, in the start `condition` and every `fields` / `filter` entry. `references/examples-flows.md`: a wall-clock hour the request names is written as said with its IANA `timezone` on the start node's `config.schedule`, never converted to UTC by hand (a bare expression runs in UTC and records no zone); the schedule example carries one. `references/state-machines-and-approvals.md`: a flow reacting to the mirrored `approvalStatusField` runs as the person who acted and stays `runAs: 'user'`; only the SLA auto-decision and the dead-run release carry no user, so a flow that must react to those declares `runAs: 'system'` — the hosted corpus's blanket "declare system" is corrected against the approval service on `main`. The same file's three Chinese glosses are gone: the shipped skill text is English-only. Three eval cases pin the teachings (flows-triggers-approvals 17–19).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/types': patch
3+
---
4+
5+
fix(types): `POST /api/v1/actions` answers a driver error carrying a string code the way `/api/v1/data` does, as a server fault
6+
7+
Clause-②: no (a status and code correction on an error answer: a driver fault inside an action body moves from a 400 refusal to the 5xx fault `/data` already answers; no accepted input and no success shape changes)
8+
Metadata-protocol: none
9+
10+
An action body that hit a driver error carrying its own string code (`SQLITE_BUSY`, `ECONNREFUSED`, `57P01`) and no HTTP status was answered by `POST /api/v1/actions/:object/:action` as a client refusal: `400 VALIDATION_ERROR`, the driver's text as the message, and the driver's code in `declaredCode`. `/api/v1/data` answers the same throw as a server fault. The MCP `run_action` and `resume_run` tools answer what `/actions` answers, so they moved with it.
11+
12+
| The action threw | `/actions` answered | `/actions` and `/data` now answer |
13+
| --- | --- | --- |
14+
| `{ code: 'SQLITE_BUSY', message: 'SQLITE_BUSY: database is locked' }` | `400`, `VALIDATION_ERROR`, the driver text, `declaredCode: 'SQLITE_BUSY'` | `500`, `DATABASE_ERROR`, `Internal data error` |
15+
| `{ code: 'ECONNREFUSED', message: 'connect ECONNREFUSED 127.0.0.1:5432' }` | `400`, `VALIDATION_ERROR`, the driver text, `declaredCode: 'ECONNREFUSED'` | `500`, `INTERNAL_ERROR`, `Internal server error` |
16+
17+
The driver's code and text are logged on the server instead, as a `driver fault` line.
18+
19+
- **Which throws move.** A throw that declared no status and whose `code` is not a closed ADR-0112 code, and only when the `/data` door's classifier (`mapDataError`) answers it as a server fault. `actionsDoorAnswerOf` (`@objectstack/types`) asks that classifier for this case; it holds no copy of its reading.
20+
- **Unchanged.** A closed code with no status (`RECORD_LOCKED`, `PERMISSION_DENIED`) is still the `400` refusal with that code. A bare `Error` is still `400 VALIDATION_ERROR` with its own sentence. A throw that declared its status keeps it, and an unregistered code beside it still rides `declaredCode`. A sandboxed action body's coded refusal (`code: 'CREDIT_LIMIT'` with no status) is still the `400` refusal with `declaredCode`, which is what `/data` answers for it.
21+
- **Stated cost.** An in-process action handler that throws its own unregistered code with no status, which `/data` also answers as a fault, now gets the fault answer here too and loses the code (the 2026-08-27 ruling on #12509: the discriminator is the status channel). It keeps its code by declaring the status it means.
22+
23+
This supersedes the line in the `31271` changeset that says a driver string code answers `400 VALIDATION_ERROR` with `declaredCode` at `/actions` and that the difference from `/data` is not changed.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
`objectstack-platform`: § Seed Data now names `ignore` as the seed `mode` default (`SeedMode` defaults to `ignore`, not `upsert`), and § `requires:` says that `--preset minimal` keeps `job` and `queue` when `email`, `approvals` or `auth` is present instead of dropping every always-on token. `objectstack-automation`'s DocuSign eval case no longer forbids a string its own model answer uses, and its model answer now verifies DocuSign Connect's own signature header through `config.signature` instead of polling.

‎content/docs/protocol/kernel/config-resolution.mdx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ The exception is a `json` specifier, which persists a JSON object or array
267267
cascade. The save door refuses the same values for a `json` key with an
268268
`invalid_type` field error, so a client sends the parsed value, never its text.
269269

270+
A `map` specifier (keyed rows, such as `lifecycle.quotas`) is judged further,
271+
at both doors alike: its JSON text must parse to an object whose every key the
272+
setting admits (the running system serves the admissible keys, for example the
273+
objects that declare a lifecycle) and whose every value is of its column's kind,
274+
such as a duration like `7y` or a whole number above 0. An override that is not
275+
is not in force, with one `error` line naming the entry and the form expected:
276+
277+
```bash
278+
OS_LIFECYCLE_QUOTAS='{"sys_audit_log": 1000000}'
279+
OS_LIFECYCLE_RETENTION_OVERRIDES='{"sys_job_run": {"maxAge": "90d"}}'
280+
```
281+
270282
**What is stored beneath a pin is listed by the namespace read.** An override in
271283
force answers `source: 'env'`, `locked: true`, and `get()` / `getMany()` build
272284
that answer from the env alone, without reading the store. `getNamespace()` — the

‎content/docs/references/system/settings-manifest.mdx‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ const result = ResolvedSettingValueSchema.parse(data);
123123
| **pattern** | `string` | optional | Regex pattern (text only) |
124124
| **rows** | `integer` | optional | |
125125
| **handler** | `{ kind: 'http'; method?: Enum<'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'>; url: string; body?: Record<string, any>; … } \| { kind: 'action'; name: string; params?: Record<string, any>; confirmText?: string \| Record<string, string> } \| { kind: 'navigate'; url: string; target?: Enum<'_self' \| '_blank'> }` | optional | Action handler (action_button) |
126+
| **keyColumn** | `{ label: string \| Record<string, string>; description?: string }` | optional | Key column (map) |
127+
| **columns** | `{ name: string; label: string \| Record<string, string>; description?: string; kind: Enum<'duration' \| 'positive_integer'> }[]` | optional | Value columns (map): one stores a scalar per key, several an object |
126128
| **confirmOffText** | `string \| Record<string, string>` | optional | Confirm dialog text shown before a toggle's value changes to off (omit = no confirm) |
127129
| **childNamespace** | `string` | optional | Sub-namespace (child_pane) |
128130
| **bannerText** | `string` | optional | Markdown body (info_banner) |
@@ -179,7 +181,7 @@ const result = ResolvedSettingValueSchema.parse(data);
179181

180182
| Property | Type | Required | Description |
181183
| :--- | :--- | :--- | :--- |
182-
| **type** | `Enum<'group' \| 'child_pane' \| 'info_banner' \| 'title_value' \| 'text' \| 'textarea' \| 'password' \| 'email' \| 'url' \| 'phone' \| 'number' \| 'toggle' \| 'select' \| 'radio' \| … +5 more>` | ✅ | Specifier variant |
184+
| **type** | `Enum<'group' \| 'child_pane' \| 'info_banner' \| 'title_value' \| 'text' \| 'textarea' \| 'password' \| 'email' \| 'url' \| 'phone' \| 'number' \| 'toggle' \| 'select' \| 'radio' \| … +6 more>` | ✅ | Specifier variant |
183185
| **id** | `string` | optional | Stable identifier (snake_case) |
184186
| **key** | `string` | optional | Storage key (snake_case) |
185187
| **label** | `string \| Record<string, string>` | ✅ | Display label |
@@ -206,6 +208,8 @@ const result = ResolvedSettingValueSchema.parse(data);
206208
| **pattern** | `string` | optional | Regex pattern (text only) |
207209
| **rows** | `integer` | optional | |
208210
| **handler** | `{ kind: 'http'; method?: Enum<'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'>; url: string; body?: Record<string, any>; … } \| { kind: 'action'; name: string; params?: Record<string, any>; confirmText?: string \| Record<string, string> } \| { kind: 'navigate'; url: string; target?: Enum<'_self' \| '_blank'> }` | optional | Action handler (action_button) |
211+
| **keyColumn** | `{ label: string \| Record<string, string>; description?: string }` | optional | Key column (map) |
212+
| **columns** | `{ name: string; label: string \| Record<string, string>; description?: string; kind: Enum<'duration' \| 'positive_integer'> }[]` | optional | Value columns (map): one stores a scalar per key, several an object |
209213
| **confirmOffText** | `string \| Record<string, string>` | optional | Confirm dialog text shown before a toggle's value changes to off (omit = no confirm) |
210214
| **childNamespace** | `string` | optional | Sub-namespace (child_pane) |
211215
| **bannerText** | `string` | optional | Markdown body (info_banner) |
@@ -231,6 +235,7 @@ const result = ResolvedSettingValueSchema.parse(data);
231235
* `slider`
232236
* `color`
233237
* `json`
238+
* `map`
234239
* `action_button`
235240

236241
### Nested Shape: `Specifier.options[number]`
@@ -269,6 +274,22 @@ const result = ResolvedSettingValueSchema.parse(data);
269274
| **url** | `string` | ✅ | Target URL or in-app route |
270275
| **target** | `Enum<'_self' \| '_blank'>` | optional (default: `"_self"`) | |
271276

277+
### Nested Shape: `Specifier.keyColumn`
278+
279+
| Property | Type | Required | Description |
280+
| :--- | :--- | :--- | :--- |
281+
| **label** | `string \| Record<string, string>` | ✅ | Key column header |
282+
| **description** | `string` | optional | Help text for the key column |
283+
284+
### Nested Shape: `Specifier.columns[number]`
285+
286+
| Property | Type | Required | Description |
287+
| :--- | :--- | :--- | :--- |
288+
| **name** | `string` | ✅ | Column identifier: the stored property name when the map has several value columns |
289+
| **label** | `string \| Record<string, string>` | ✅ | Column header |
290+
| **description** | `string` | optional | Help text for the column |
291+
| **kind** | `Enum<'duration' \| 'positive_integer'>` | ✅ | Value kind: duration literal or positive integer |
292+
272293

273294
---
274295

@@ -367,6 +388,7 @@ This schema accepts one of the following structures:
367388
* `slider`
368389
* `color`
369390
* `json`
391+
* `map`
370392
* `action_button`
371393

372394

‎docs/adr/0007-settings-manifest-and-kv-store.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ADR-0007: Settings — Manifest + K/V Store + Resolver (Apple-style)
22

3-
**Status**: Accepted — backend implemented; UI pending (objectui) (proposed 2026-05-20 · calibrated 2026-06-12) · **Amended (2026-11-05, #30385)** — D6: a clear (`null`) of an env-pinned key is not refused; it clears the stored value beneath the override and changes nothing in force.
3+
**Status**: Accepted — backend implemented; UI pending (objectui) (proposed 2026-05-20 · calibrated 2026-06-12) · **Amended (2026-11-05, #30385)** — D6: a clear (`null`) of an env-pinned key is not refused; it clears the stored value beneath the override and changes nothing in force. · **Amended (2026-11-08, #30208)** — §Specifier set gains `map` (keyed rows with typed value columns); `json` stays for raw config and is no longer the home for maps.
44
**Deciders**: ObjectStack Protocol Architects
55
**Builds on**: [ADR-0005](./0005-metadata-customization-overlay.md) (Metadata Customization Overlay), [ADR-0006 v4](./0006-project-environment-split.v4.md) (Project/Environment Split — this record was originally built on v3, superseded by v4)
66
**Consumers**: `@objectstack/spec`, `@objectstack/platform-objects`, new `@objectstack/service-settings`, `@objectstack/plugin-auth` (Setup app), `objectui` (Settings renderer)
@@ -106,6 +106,8 @@ ObjectStack's protocol-first DNA matches Apple's: a small set of declarative spe
106106

107107
A small, **closed** set of specifier types. Borrowed from Apple's PreferenceSpecifiers and trimmed to what enterprise settings actually need. New types require an ADR amendment.
108108

109+
*Amended 2026-11-08 (#30208, ruling record 6715997428): `map` added. A setting whose value is a map of rows (an object → a window, an object → a row count) declares that shape as a `map`, so the console draws a table and both doors (the save and the `OS_*` override) judge each key against the running system's domain and each cell against its column's kind, as they judge `options` and `pattern`. Its stored value is the object a `json` key held, unchanged. `json` stays in the set for genuinely raw config; it is no longer the home for maps.*
110+
109111
| Specifier | Renders as | Persists | Notes |
110112
|---|---|---|---|
111113
| `group` | section header + divider | — | `visible` expression supported for conditional sections |
@@ -120,7 +122,8 @@ A small, **closed** set of specifier types. Borrowed from Apple's PreferenceSpec
120122
| `multiselect` | checkbox list / tag picker | array | |
121123
| `slider` | range slider | number | `min`, `max`, `step` |
122124
| `color` | colour picker | hex string | |
123-
| `json` | code editor | object | for advanced/raw config |
125+
| `json` | code editor | object | for advanced/raw config — not for maps (see `map`) |
126+
| `map` | keyed rows: a key column + typed value columns | object: `Record<key, value>` with one value column, `Record<key, {column: value}>` with several | `keyColumn`, `columns: [{name, label, kind}]`, `kind` ∈ `duration` \| `positive_integer`; the keys a map admits are served by a runtime option source, never listed in the manifest |
124127
| `title-value` | read-only label | — | display computed/derived values |
125128
| `child-pane` | nav row → sub-page | — | references another manifest namespace |
126129
| `action-button` | button | — | triggers `handler` (HTTP / built-in) |

‎docs/audits/2026-07-unknown-key-strictness-ledger.counts/system.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ hand-patch a number here** — fix the code or the verdict and regenerate.
1919

2020
| Dir | Sites |
2121
|---|---|
22-
| `system/` | 397 |
22+
| `system/` | 399 |

‎examples/app-showcase/objectstack.config.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,21 @@ export default defineStack({
9292
// • automation — AutomationServicePlugin (flow engine + node executors).
9393
// • approvals — ApprovalsServicePlugin, so the `approval` flow node
9494
// (ADR-0019) is contributed to the engine.
95-
// • messaging — MessagingServicePlugin, so the `notify` node delivers to
96-
// the inbox channel (`sys_inbox_message` rows) instead of
97-
// degrading to a logged no-op.
9895
// • triggers — record-change + schedule FlowTrigger plugins, so the
9996
// autolaunched / schedule flows below actually auto-fire.
100-
// • job — JobServicePlugin, the timing backend the schedule trigger
101-
// delegates to (interval / cron jobs).
10297
// • marketplace — PackageServicePlugin (sys_packages store). Enables the AI
10398
// blueprint flow to auto-create a writable "app package" home
10499
// (ADR-0033 zero-package app building) and the Studio package
105100
// selector to list DB packages.
106101
// • mailbox — MailboxServicePlugin: the inbound-mail objects
107102
// (`sys_mailbox`, `sys_mail_message`, `sys_mail_association`)
108103
// and their read gates, served through the data API.
109-
requires: ['ui', 'automation', 'approvals', 'messaging', 'triggers', 'job', 'marketplace', 'webhooks', 'realtime', 'mailbox'],
104+
// Not listed: `messaging` (the `notify` node's inbox delivery) and `job` (the
105+
// timing backend the schedule trigger delegates to) are always-on core
106+
// capabilities that every boot mounts, listed or not. A `--preset minimal`
107+
// boot drops `messaging`, and drops `job` only when `email`, `approvals`
108+
// or `auth` is absent; there, list what it drops.
109+
requires: ['ui', 'automation', 'approvals', 'triggers', 'marketplace', 'webhooks', 'realtime', 'mailbox'],
110110

111111
// Concrete connectors for the `connector_action` node. The baseline engine
112112
// ships the dispatch node + an empty registry; these plugins populate it.

0 commit comments

Comments
 (0)