Skip to content

Commit fcafa11

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-4ntp5s
2 parents 0e3561f + cba7d8a commit fcafa11

109 files changed

Lines changed: 5660 additions & 606 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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/cloud-connection': patch
4+
'@objectstack/cli': patch
5+
---
6+
7+
feat(cloud-connection)!: a managed upgrade that renames or retypes a stored field is refused until it is declared or confirmed
8+
9+
Clause-②: yes (narrowing) — a managed re-install through install-local that installed before is refused `409 SCHEMA_UPGRADE_CONFIRMATION_REQUIRED` when its package upgrade plan lists an undeclared suspected rename or a `needs_confirm` / `destructive` type change, and `501 NOT_IMPLEMENTED` when it declares a field rename (`renamedFrom`) this runtime cannot carry yet. The widening half: the error-code ledger registers `SCHEMA_UPGRADE_CONFIRMATION_REQUIRED` under `@objectstack/cloud-connection`, install-local takes `confirmSchemaUpgrade`, and `os package install` and `os deploy` take `--confirm-upgrade`.
10+
Metadata-protocol: none
11+
12+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no export is removed: the refusal judges two package bodies at the install door, so there is nothing for a migration to rewrite and no tombstone. The way through is a token the refusal itself prints. -->
13+
14+
**BREAKING** accept-set narrowing at the install-local door (`POST /api/v1/marketplace/install-local`, `@objectstack/cloud-connection`) for a managed re-install over an installed package.
15+
16+
Before any write, after the access upgrade check, the door compares the installed version (its ledger entry) with the incoming one through `comparePackageVersions` (`@objectstack/metadata-core`), the comparison the dry run and `os diff` read:
17+
18+
- **A suspected rename** (in one object, a stored field removed while a stored field is added, with no `renamedFrom` linking them) or **a type change** the drift categories call `needs_confirm` (both columns stored) or `destructive` (the new type stores no column) answers `409 SCHEMA_UPGRADE_CONFIRMATION_REQUIRED`. `error.details.findings` names each with a one-line `describe` (and, when the runtime's `manifest` service answers `planUpgrade`, the rows the installed column holds); `error.details.findingSet` is the token. The same request with `"confirmSchemaUpgrade": "<findingSet>"` installs, as the additive schema sync leaves the fields, and the ledger entry records `schemaUpgradeConfirmation` (the token, who, when). A token from another finding set is refused again with the fresh one. A type change riding on a declared rename is judged on its own.
19+
- **The installed side** is the ledger entry's body; an orphaned install (the registry still serves the package, the ledger holds no record) is compared against the body the registry serves. When there is no installed body to compare — the ledger file will not parse, or neither the ledger entry nor the orphan's registry row carries a body — the same `409` names that as its one finding (`installed_record_unreadable` with the file and the cause, or `installed_record_missing`), and its token admits the re-install, which rewrites the record; a rename the incoming version declares still answers the `501` below.
20+
- **A declared rename** (`renamedFrom` on a field of the new version) answers `501 NOT_IMPLEMENTED`, naming each rename: this runtime cannot yet move a renamed field's values to its new key, and no token answers it.
21+
- A `safe` type change (the installed field had no stored column), a removed field or object and a seed dataset change are refused by nothing; `dryRun: true` reports them.
22+
23+
A first install, an `unmanaged` install and a re-install whose plan lists none of these answer as before.
24+
25+
**Migration.** A package author whose upgrade is refused either declares the rename on the new field — `renamedFrom: ['<old key>']` — and rebuilds, or confirms the findings as listed: `os package install <artifact> --confirm-upgrade <findingSet>` (`os deploy --confirm-upgrade <findingSet>` against a self-hosted runtime), or `"confirmSchemaUpgrade": "<findingSet>"` in the install-local body. A host that calls install-local itself reads `error.details.findingSet` off the 409 and sends it back. Preview the refusal first with `os package install <artifact> --dry-run`.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime)!: a package uninstall is refused while an active validation rule reads a field the package adds through `objectExtensions`
6+
7+
Clause-②: yes (narrowing) — `DELETE /api/v1/packages/:id` now refuses, with `409 PACKAGE_DISABLE_RESTRICTED_BY_VALIDATION_RULE`, an uninstall it used to perform: one whose package adds a field through `objectExtensions` that an active validation rule of another enabled package reads.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no stored row changes shape: what moves is the uninstall door's answer to a request that would leave a validation rule reading a withdrawn field. Nothing at rest records that answer, so there is nothing for a migration to rewrite. -->
11+
12+
**BREAKING** accept-set narrowing at the uninstall door (`@objectstack/runtime`): `DELETE /api/v1/packages/:id` asks the dependent-rule check the disable door (`PATCH /api/v1/packages/:id/disable`) already asks, and refuses on the same verdict.
13+
14+
- **Before.** The uninstall withdrew the package's `objectExtensions` fields from the served objects with no check. Another enabled package's active validation rule that read one of those fields then failed closed, so every write to that rule's object answered `400 VALIDATION_FAILED`, and with the package gone there was nothing left to re-enable.
15+
- **Now.** While such a rule exists, the uninstall answers `409` with the nested `{ "error": { "code": "PACKAGE_DISABLE_RESTRICTED_BY_VALIDATION_RULE", "message" } }` body, and nothing moves: the stored rows, the running registry and the environment's disable record stay as they were. The message is the disable door's sentence in its uninstall form: `Package 'ID' cannot be uninstalled: an active validation rule reads a field it adds through objectExtensions, which the uninstall would withdraw — PACKAGE · OBJECT · RULE (reads FIELD). Switch off or change that rule first, or keep the package installed.`, naming every such rule with the fields it reads. The check is the one the package entry exports as `readPackageDisableDependents`; the sentence is `formatPackageDisableDependents`, which takes a new optional third argument, `{ operation: 'disable' | 'uninstall' }` (default `'disable'`, whose sentence is unchanged), so a host door that uninstalls answers the same words. An uninstall no rule depends on, and an uninstall of a package that is already disabled, proceed exactly as before.
16+
- **Who moves.** A caller that uninstalls a package whose field another package's active rule reads.
17+
18+
**The remedy.** Switch off or change the rules the message names first (a packaged rule can be switched off through the tenant overlay), then uninstall.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/plugin-auth': patch
4+
'@objectstack/runtime': patch
5+
---
6+
7+
fix(auth): an MCP access token is recorded as used only once the MCP door admits the call, so a banned person's refused calls no longer show their AI assistant as used
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
`IAuthService` gains one optional member, `recordMcpAccessTokenUse(principal)`. Verifying a token is not admitting the call: the MCP door (`@objectstack/runtime`) refuses a banned subject after `verifyMcpAccessToken` answers, and a call whose authorization store cannot be read is a 503. Before this change `AuthManager.verifyMcpAccessToken` itself scheduled the coarse last-use stamp (`sys_oauth_consent.last_used_at`), so an administrator reading `GET /admin/authorized-clients?userId=` for a banned person saw the assistant as used in an hour when every call was refused.
13+
14+
Now `verifyMcpAccessToken` records nothing. The door calls `recordMcpAccessTokenUse` once, after its ban read and after the request context resolves, with the very object the verifier returned; `AuthManager` stamps only a principal object its own verifier returned, once, so a hand-built principal or a copy records nothing. The member returns nothing and never throws. The stamp's bound is unchanged: at most one write per consent per hour in each process.
15+
16+
A custom `IAuthService` needs nothing: the member is optional, and a door whose auth service lacks it admits the call exactly as before. A host that calls `AuthManager.verifyMcpAccessToken` itself and wants the call shown as used calls `recordMcpAccessTokenUse(principal)` with the verifier's result once it has admitted the call.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/fields': patch
3+
'@object-ui/components': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/cli': patch
6+
'@objectstack/plugin-sharing': patch
7+
---
8+
9+
feat(console): the sharing-rule object picker lists only the objects a rule can take effect on, business objects first
10+
11+
Clause-②: yes (widening) — `field:shareable-object-ref` joins `@object-ui/fields`' registered widget keys (`RegisteredFieldWidgetType`) and the console's known schema types; nothing is narrowed and no translation key is added.
12+
Metadata-protocol: none
13+
14+
The object field of a new sharing rule listed every registered object, most of them platform `sys_*` objects, including ones a save refuses with `SHARING_NOT_ENABLED` and the credential and session objects. It now lists only what `GET /api/v1/sharing/shareable-objects` answers: the objects a rule saved on would take effect on, business objects first and then platform objects, each group by label, in the order the server sends.
15+
16+
- **The widget (`@object-ui/fields`).** `field:shareable-object-ref` reads the list through the host's authenticated fetch (`SchemaRendererContext.apiFetch`) and stores the object's name, as `object-ref` does, with the same `Label (name)` spelling. A stored name the list does not hold stays on screen as its own option, so editing a rule never drops it. The read-only face is `object-ref`'s.
17+
- **When the list is not served.** A `403` (the caller is not a sharing-rule administrator), a `501` (sharing rules do not run on this deployment), any other failed or unreadable answer, and a host with no authenticated fetch all give the `object-ref` picker over every registered object, as before. The field is never an empty picker; the save doors still decide which object a rule may name.
18+
- **The declaration (`@objectstack/plugin-sharing`).** `sys_sharing_rule.object_name` declares `widget: 'shareable-object-ref'` (was `object-ref`). A console without the widget draws the field as a text box, as with any unregistered widget.
19+
- **The list cell, the record form and the grid.** The new key draws the same object label cell as `object-ref` (`@object-ui/app-shell`), the record form hands it the data source its fallback reads (`@object-ui/components`), and it is not edited inline in a grid cell, like the other widget-hint pickers.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/lint': minor
3+
---
4+
5+
fix(lint)!: a flow node no edge path from the start node reaches is refused at build and publish (`flow-node-unreachable`), because a run never executes it
6+
7+
Clause-②: yes (narrowing) — `os validate`, `os build`, `os lint` and the flow save and publish doors refuse a flow they accepted before; `@objectstack/lint` also exports the rule id `FLOW_NODE_UNREACHABLE`, and `RULE_EXPLANATIONS` gains its entry.
8+
Metadata-protocol: narrowed
9+
Skills-docs: none — `skills/**` and `content/docs/**` teach only wired top-level flows; the edgeless examples in `content/docs/automation/flows.mdx` are region bodies, which this rule does not judge. The reasoning ships as the `os explain flow-node-unreachable` entry.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed or renamed: FlowSchema keeps its shape and meaning, and lint now refuses a graph whose node no edge from the start node reaches. Such a node never ran (a run starts at the start node and follows edges), so there is no rewrite that keeps what the author meant: the author wires the node in or deletes it, and the finding says which node. -->
12+
13+
**BREAKING** accept-set narrowing in `os validate` / `os build` / `os lint` and at the flow publish doors (`PUT /api/v1/meta/flow/NAME` live save, the per-item and package publish; Studio, REST and MCP authors), through the gating `lintFlowPatterns` rule.
14+
15+
- **Before.** A flow whose top-level node had no edge path from the start node (`nodes: [start, stamp, end]`, `edges: [start → end]`) parsed, built, saved, published and registered, and reported itself as configured. The engine starts a run at the start node and follows edges, so `stamp` never ran, and nothing said so.
16+
- **Now.** `flow-node-unreachable` (severity `error`) names each such node: `flow 'NAME' · node 'ID' (TYPE)`, why it never runs, and the fix. A draft save still stores, with the finding in its `_diagnostics`, so a designer that deletes a node and leaves its successor unwired can keep saving; the publish refuses it.
17+
- **A second start node.** A run starts at the first start node, so a second one is reported too; its hint says to delete the extra start rather than wire an edge into it.
18+
- **What counts as reaching a node.** Every edge type: default, conditional, fault and back. A `boundary_event` node, and the nodes only it leads to, are not judged (they are reached by attachment, not by an edge).
19+
- **Not judged.** Nodes inside a region body (a region is a single-entry acyclic graph that the region validator already holds, so all of it is reached); a flow with no start node; a flow with an edge whose endpoint names no node (the flow parse refuses that first).
20+
- **Why lint and not the flow parse.** The metadata save door parses `FlowSchema` on every save, drafts included, and the Studio designer's node delete can leave a successor unwired. A parse rule would refuse that draft save outright.
21+
22+
**What an author does.** Nothing for a flow whose nodes are all wired from the start node. For a refused node: add an edge into it from a node that runs, or delete the node. A refused node never ran, so neither choice changes what the flow did.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec): declare the optional `ISecurityService.describeEffectiveAccess` and its `EffectiveAccess` answer types
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
`@objectstack/spec/contracts` gains three exported types and one optional member of the `security` service contract, beside `DelegableScope` / `describeDelegableScope`:
11+
12+
- `EffectivePermissionSetOrigin`: how a permission set reaches a user, one of `{ kind: 'direct' }` (a `sys_user_permission_set` grant row of the user's), `{ kind: 'position'; position }` (a held position's definition names the set, including a built-in identity position's static binding), `{ kind: 'default' }` (a binding to the `everyone` audience anchor, or the human baseline the resolution adds) and `{ kind: 'derived'; source }` (standing the resolver confers without a grant row or a position, from the closed sources `'platform_admin_config'` and `'ai_access'`).
13+
- `EffectivePermissionSet`: `{ name, origins }`, at least one origin; a set reached two ways is listed once with both.
14+
- `EffectiveAccess`: `{ userId, organizationId, positions, permissionSets }`, in the caller's organization; `positions` and `permissionSets` in the resolver's own order, which the contract spells out.
15+
- `ISecurityService.describeEffectiveAccess?(userId, callerContext?)`: describe a user's effective permission sets and where each comes from, resolved by the resolver enforcement uses, gated as `explain` is (`manage_users`, organization administration of an organization the user belongs to, or a delegated `adminScope` covering the user), with an unknown user refused exactly as one the caller may not manage. Optional: a security service that predates it omits it, and callers feature-detect and answer that the read is not served.
16+
17+
A TypeScript contract only: no schema, authorable key or runtime answer changes here. The reference implementation and its REST door land separately.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(console): the marketplace catalog is filtered and paged by the server
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The Console's marketplace page read the first 100 listings once and filtered them in the browser, so a catalog of more than 100 listings could never show the rest. It now reads one page at a time from `GET /api/v1/marketplace/packages`, and the search text, the facet selection and the page window travel with the read:
11+
12+
- `businessFunctions`, `industries` and `solutionTypes`, each one comma-joined parameter (`?businessFunctions=sales,marketing`), OR inside a facet and AND across facets, as the list door applies them. A facet with nothing selected is left out, never sent empty, and the retired `category` is never sent.
13+
- The search box sends its text as `q` once typing pauses, and the list door does the matching.
14+
- `limit` / `offset`: a pager under the cards walks the door's `total`, 24 listings a page. A new search or selection starts again from the first page.
15+
16+
`listMarketplacePackages` takes the four filters, `maturity` included, which the page itself does not select.
17+
18+
A drawn facet now lists every value the marketplace declares, in the spec's order, and no longer prints a count beside each value: one page of the filtered catalog cannot count the catalog, and the list door answers no counts. A facet appears once some listing the door answered carries it, and stays while a selection narrows the page, so a catalog that serves no taxonomy still draws no filter.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/mcp': patch
3+
---
4+
5+
fix(mcp): a sandboxed hook body that crashes while declaring a code is a fault on MCP, not a refusal at its declared status
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A QuickJS hook body that crashed while declaring a code, for example `throw Object.assign(new TypeError('boom'), { code: 'RECORD_LOCKED', status: 409 })`, reached every MCP tool and the `objectstack://objects/{name}/records/{id}` resource as `{ code: 'RECORD_LOCKED', message: "hook '<name>' threw: TypeError: boom", status: 409 }`: the hook's internal name and the native error text, at a status that reads as a business refusal. `/api/v1/data`, `/meta` and `/actions` classify such a crash first and answer `500 INTERNAL_ERROR`.
11+
12+
MCP now asks the doors' own crash predicate (`isSandboxCrash`, `@objectstack/types`) before it reads a thrown code, so a crash with a declared code is answered as the same crash with no code. The record data tools (`query_records`, `aggregate_records`, `get_record`, `create_record`, `update_record`, `delete_record`) answer `{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error", "status": 500 } }` and log the crash once on the server, as `/api/v1/data` does. The other tools, `delete_records` and the record resource answer what they answer today for a crash with no code. A sandboxed body's coded refusal (no crash) is unchanged.

0 commit comments

Comments
 (0)