You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 74a7e4c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(rest): the import door's `mappingName` takes the `/meta` door's qualified address `NAMESPACE/NAME`, so a mapping name two packages hold can be imported by naming its holder (ADR-0150 D5)
6
+
7
+
Clause-②: yes
8
+
Metadata-protocol: none
9
+
10
+
`POST /api/v1/data/:object/import` and `POST /api/v1/data/:object/import/jobs` read `mappingName: "<namespace>/<name>"` as the address `GET /api/v1/meta/mapping/<namespace>/<name>` reads, through the same protocol reads (`resolveMetaItemAddress`, then the exact qualifier `?package=` naming the namespace's holder): the import applies exactly that package's mapping. `"_env/<name>"` names the mapping saved in the environment (`admitEnvironmentQualifier`). A qualifier naming a namespace, or the environment, that holds no mapping of the name while a package does is refused `409 RESOURCE_CONFLICT` with the `not-held-by-qualifier` sentence that read answers, naming every holder, and no row is written.
11
+
12
+
Only a new optional spelling is added. A `mappingName` with no `/` reads and answers exactly as before: the environment's own mapping, else the one package holder, else `409` naming both holders. A first segment that is neither `_env` nor an installed namespace is no address, and the whole string is read as the name it always was read as (a mapping name is snake_case, so it answers `404 MAPPING_NOT_FOUND`), never the part after the `/`. The address keeps the metadata read's two limits: a shareable namespace (`base`, `system`, `sys`) two of whose packages hold the name answers `409` naming both, and a mapping named like a `/meta` sub-resource segment (`history`, `layers`, …) has no qualified address.
fix(plugin-auth)!: a user a SCIM directory provisions reads `idp_provisioned` from the moment SCIM creates it, and users a directory provisioned earlier are marked once at boot
7
+
8
+
Clause-②: yes (narrowing) — every refusal and hidden action keyed on a directory-owned identity (`sys_user.source = 'idp_provisioned'`) now applies to a SCIM-provisioned user who holds no local password: `POST /api/v1/auth/admin/set-user-manager` answers `403 PERMISSION_DENIED` with reason `idp_provisioned`; the admin bulk import (`POST /api/v1/auth/admin/import-users`) refuses that user's `manager_id` link through the same refusal; `admin/set-user-password` on a cloud-managed environment answers `409 RESOURCE_CONFLICT`; the Setup "Set Manager" row action is hidden; and the self-service Change Password, Change Email and Delete My Account actions are hidden (ADR-0135 D4, D5.2).
9
+
Metadata-protocol: none
10
+
11
+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, no export changes, and `sys_user.source` keeps its two values. The stored rows the rule covers are marked by the boot pass itself, so there is nothing for a migration to rewrite. -->
12
+
13
+
**BREAKING** accept-set narrowing for SCIM-provisioned users (ADR-0135 D4).
14
+
15
+
- A user a SCIM connection creates, re-links through a tombstone or reprovisions reads `sys_user.source = 'idp_provisioned'` ("IdP-Provisioned" in Setup), written in the same transaction as the SCIM write. On a create or another active write the mark fails closed: if it cannot be written, the SCIM request fails, nothing persists, and the identity provider retries it. On a deactivation or a `DELETE` the account is disabled first and the mark after it is best-effort, so a mark that cannot be written never leaves a deprovisioned account enabled; it is logged at `error` and re-run by the next active write and the boot pass.
16
+
- At boot, every user that owns a `sys_scim_subject` row and does not already read `idp_provisioned` is marked. The pass logs how many users it marked and writes nothing on a later boot.
17
+
- A user who holds a local password keeps `env_native`: setting a password on a directory-provisioned user still flips it to `env_native`, and a later SCIM sync or boot leaves that value.
**Who moves: the manager of a SCIM-provisioned user.** For a SCIM-provisioned user with no local password, the admin set-manager endpoint, the Setup "Set Manager" button and the bulk import's `manager_id` column all refuse ("directory wins, per identity"). The platform does not write the manager from SCIM: it declares the SCIM `manager` attribute without projecting it onto `sys_user.manager_id`, and an existing `manager_id` value stays as it is. An approval node whose `manager` rung resolves to nobody for such a user can declare `onEmptyApprovers: 'fallback'` with a `fallbackApprovers` list; the other remedy is a provisioning path your deployment supplies that writes the column.
fix(spec,lint)!: `deriveColumnSummary` declares the stored value a `min` / `max` column summary answers, and an `object-grid` aggregation that sums or averages a field the aggregate × field-type table refuses is refused at authoring (`grid-aggregation-field-type-refused`) (#32144)
7
+
8
+
Clause-②: yes (narrowing)
9
+
Both halves: item 1 widens a published return type of `deriveColumnSummary`; item 2 narrows what authoring accepts for an `object-grid` aggregation.
10
+
Metadata-protocol: narrowed
11
+
Skills-docs: none — `skills/**` and `content/docs/**` teach no `object-grid``aggregations` entry and no return type of `deriveColumnSummary`; the reasoning ships as the `os explain grid-aggregation-field-type-refused` entry.
12
+
13
+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed or renamed: GridAggregationSchema keeps its shape, and lint now gives an object-grid aggregation the verdict the engine aggregate door already gives the same pair at query time. A refused pair never drew a meaningful number (a grid that owns its fetch had its grouped header query answered 400 INVALID_FIELD, a grid handed its rows drew 0 for a text sum), and which field or function the author meant is not something a conversion can choose; the refusal names the aggregates the field's type accepts. -->
14
+
15
+
**`deriveColumnSummary` (`@objectstack/spec/ui`).** Its declared return was `number | null | undefined`, but a `min` / `max` column carries the aggregated field's STORED value: ISO text for a `datetime`, `YYYY-MM-DD` for a `date`. The function is now generic over the summary it is given and returns `ColumnSummaryValue<S> | null | undefined`, a new exported type: a `number` for `count`, `count_unique`, `sum`, `avg`, `count_filled`, `count_empty`, `percent_filled` and `percent_empty`, `unknown` for `min` / `max`, and nothing for `none`. Nothing is converted at runtime: a date turned into a number would lose the value a renderer draws.
16
+
17
+
-**Who notices.** A TypeScript caller that passes a summary typed as the whole `ColumnSummary` union (or `ColumnSummary | ColumnSummaryConfig`) now gets `unknown`, because that summary may be `min` / `max`; a caller that did arithmetic on that result must narrow it first (`typeof value === 'number'`), or pass a literal member. A caller passing a literal counting member (`'sum'`, `{ type: 'percent_empty', … }`) still gets `number | null | undefined`.
18
+
19
+
**BREAKING** accept-set narrowing in `os validate` / `os build` / `os lint` and at the page publish door (`PUT /api/v1/meta/page/NAME`; Studio, REST and MCP authors): an `object-grid` block whose `properties.aggregations` entry is `sum` or `avg` over a field the aggregate × field-type table (`AGGREGATE_FIELD_TYPE_COMPATIBILITY`) refuses for that function is refused at `error`, rule `grid-aggregation-field-type-refused`.
20
+
21
+
-**Before.**`{ field: 'created_at', type: 'sum' }` (or `avg` over a text, date, option, reference or `formula` field, or `sum` over a `percent`) passed authoring. A grid that owns its fetch then had its grouped header query refused by the engine's `aggregate` door with `400 INVALID_FIELD`; a grid handed its rows (`data.provider: 'value'`) grouped them in the browser and drew a number the pair cannot mean (`0` for a text sum).
22
+
-**Now.** The same pair is refused where the author writes it, at `pages[i]….properties.aggregations[j]`, and the fix line names the aggregates the field's type accepts (a `formula` field gets the spec's store-it-as-a-number remedy).
23
+
-**Accepted.**`sum` over number, currency, rating, slider, progress, summary, boolean and toggle; `avg` over the same plus percent; `count` over any field. `count_distinct`, `min` and `max` are not judged by this rule.
24
+
-**Not judged.** An object the stack does not define or that declares no field map, a field that does not resolve, a dotted path, a field two packages define at the same priority, and a field whose declaration carries no type (`id`) or a type outside `FieldType`.
25
+
26
+
**The remedy.** Point `sum` / `avg` at a numeric field, or aggregate the field with one its type accepts (`min` / `max` for a date, a count for text).
fix(cli): `os init` writes its starter object the way `os g object` does, with `Field.*` builders and a named export
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The `app` and `plugin` templates of `os init` wrote the starter object's fields as raw `{ type: 'text', … }` literals and exported the object as a default export only. `os generate object` and the `npm create objectstack` starter write each field through a `Field.*` builder and export the object by name, so a project created by `os init` mixed two styles as soon as its author ran `os g object`.
11
+
12
+
- FROM: `const myAppItem = ObjectSchema.create({ fields: { name: { type: 'text', … } } }); export default myAppItem;`, with the barrel line `export { default as myAppItem } from './my_app_item.object';`
13
+
- TO: `export const myAppItem = ObjectSchema.create({ fields: { name: Field.text({ … }) } }); export default myAppItem;`, with the barrel line `export { myAppItem } from './my_app_item.object';`, which is the line `os g object` appends.
14
+
15
+
The compiled object is unchanged: each builder returns the literal it replaces. The default export stays, so the starter app, the list view and any code that default-imports the object keep working. Existing projects need no change.
feat(lint): note a caller-keyed update policy that declares no check, at info tier
6
+
7
+
Clause-②: yes (widening)
8
+
Metadata-protocol: none
9
+
10
+
New rule `security-update-policy-no-check`, severity `info`. It reports a row-level policy whose `operation` is `update` or `all`, whose `using` compares a column other than `created_by` with `current_user.id` (`owner_id == current_user.id`, an assignee), and which declares no `check`. The rule it states: a row-level policy with no `check` also admits new rows the ownership floor admits; declare `check` to bound what an update may write. Its fix line states the side effect: declaring `check` on any applicable policy takes the USING-only siblings and the floor out of the check, so a creator who is not the owner loses update unless a `check` admits them. `os explain security-update-policy-no-check` carries the composition (ADR-0058 D4).
11
+
12
+
The finding refuses nothing. It is `info` tier, and `--strict` promotes warnings, never an `info` finding, so neither `os lint --strict` nor `os validate --strict` fails on it. A policy keyed on `created_by` alone, a policy that declares a non-blank `check`, a `select`, `insert` or `delete` policy and a disabled policy are not reported. The rule id is exported from `@objectstack/lint` as `SECURITY_UPDATE_POLICY_NO_CHECK`.
@@ -262,7 +275,7 @@ These are whole-request failures — nothing is written, and there is no per-row
262
275
| Status |`code`| Cause |
263
276
|:---|:---|:---|
264
277
| 404 |`MAPPING_NOT_FOUND`| No mapping artifact is registered under that name. |
265
-
| 409 |`RESOURCE_CONFLICT`| Two or more packages hold a mapping under that name, and the environment holds none; the error names every holder. |
278
+
| 409 |`RESOURCE_CONFLICT`| Two or more packages hold a mapping under that name, and the environment holds none; or a qualified `mappingName` (`<namespace>/<name>`, `_env/<name>`) names a holder that holds no mapping of that name while another does. The error names every holder. |
266
279
| 400 |`MAPPING_TARGET_MISMATCH`| The artifact's `targetObject` is not the object in the URL. |
267
280
| 400 |`MAPPING_FORMAT_UNSUPPORTED`| The artifact declares `sourceFormat: 'xml'` or `'sql'`; the endpoint accepts csv, json and xlsx payloads only. |
268
281
| 400 |`MAPPING_FORMAT_MISMATCH`| The declared `sourceFormat` contradicts the payload actually sent. A `csv` mapping does apply to an `xlsx` payload — those rows are tabular in the same way — but a `json` mapping does not. |
using: 'owner_id == current_user.id', // the rows a rep reads, edits and deletes
38
+
check: 'owner_id == current_user.id', // every row a rep's insert or update writes
39
+
},
36
40
],
37
41
});
38
42
```
39
43
44
+
-**Declare `check` on a write policy.** When no applicable policy declares `check`, each policy's `using` stands in as the write check, OR-combined with the platform's ownership floor (`created_by == current_user.id`) wherever the write's row gate keeps it, so a USING-only `owner_id` policy also admits an update by the deal's creator; once any applicable policy declares `check`, only the declared checks decide and the USING-only policies and the floor leave the check, so a creator who is not the owner loses update unless a `check` admits them.
40
45
-**"My own"** vs **"my team's"** vs **"the org's"** is the RLS *depth* axis (`readScope` / `writeScope`: `own | own_and_reports | unit | unit_and_below | org`, ADR-0057). A manager set uses `unit`; a rep uses `own`. The hierarchy-relative scopes (`own_and_reports` / `unit` / `unit_and_below`) need the enterprise hierarchy resolver and **fail closed to `own`** without it — see [Access depth](/docs/permissions/permission-sets#access-depth--readscope--writescope-adr-0057-d1).
41
46
- 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).
42
47
- For genuinely sensitive objects, set `access: { default: 'private' }` so they are **not** covered by blanket wildcard grants — access needs an explicit grant.
0 commit comments