Skip to content

Commit 3bb5c3e

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-mvgczn
2 parents 02e922a + b6fa08e commit 3bb5c3e

95 files changed

Lines changed: 3077 additions & 232 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): more of objectstack-automation's self-contained examples are type-checked by `check:skill-examples`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Six more fenced TypeScript blocks in `skills/objectstack-automation/` carry the opt-in check marker, so 9 of its 19 are now compiled against the spec. In `SKILL.md` the `notify` node is typed `FlowNode` (`@objectstack/spec/automation`). In `references/examples-flows.md` the time-relative sweep is wrapped in `defineFlow`. In `references/state-machines-and-approvals.md` the `state_machine` rule is typed `StateMachineValidation` (`@objectstack/spec/data`) and the discount approval flow is wrapped in `defineFlow` with `cel` imported. In `references/integration-recipes.md` recipes 4 and 5 import `defineFlow` / `defineConnector` from `@objectstack/spec`. No example was wrong. Of the ten left unmarked, the trigger start node in `SKILL.md` and recipes 1 to 3 in `references/integration-recipes.md` compile with a wrapper but do not fit their file's token ceiling; the rest are fragments, or, for two `SKILL.md` blocks, fences indented inside a list item, which the check does not read. The marks are paid inside each file by removing restatements whose rule lives on elsewhere in the skill; every cross-reference stays, and no rule's teaching changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
feat(app-shell): the marketplace card and package page show which languages an app ships, with coverage
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
The control plane now measures, when a version is published, which languages it carries text for and how much of the app each one translates, and serves them on the version as `supported_locales` and `locale_coverage`. The marketplace reads them:
12+
13+
- **The catalog card** names the latest version's languages in their own script, the default first, each with its coverage (`简体中文 100% · 日本語 60%`). It shows three, then how many more; the full list is the line's tooltip and what a screen reader hears.
14+
- **The package page** lists every language in its taxonomy strip, the default marked.
15+
- **A version published before the measurement** reads "No language information", never "English only".
16+
- **A catalog that does not serve the keys yet** draws nothing new: the card and page look as they did.
17+
18+
A language is named the way the header's language menu names it: a served code is read through the platform locale table first, so `zh-CN` reads 简体中文, and a code outside the table is named by the browser in its own language (`th` reads ไทย). Percents are formatted in the display locale, as the page's dates are.
19+
20+
`@object-ui/i18n` adds four keys to every marketplace catalogue: `marketplace.facet.languages`, `marketplace.languages.none`, `marketplace.languages.more` and `marketplace.languages.default`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-automation says how a `subflow` / `map` child flow name resolves, and when it is refused
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `subflow` and `map` rows of `skills/objectstack-automation/SKILL.md` now teach the engine's bare-name rule for `config.flowName` (ADR-0150 D3): a package's flow reaches its own package's flow, else the one holder in its declared `dependencies` closure plus `sys` packages; a package-less flow reaches the environment's flow, else the one package holder. Anything else passes `os validate` and fails the node at run time with the resolver's sentence naming every candidate and no error code: `outside-closure` (only an undeclared package or an environment-authored flow holds the name), `ambiguous-in-closure` / `ambiguous-in-environment` (two packages hold it; only a clash older than install's one-holder refusal, and such a name is never armed). A `map` fails at its first item. The automation evals gain a case that declares the dependency on the child flow's package.
11+
12+
Paid for by nine restatements cut from the same file, each keeping its other home:
13+
14+
1. The `screen` row's "never hand-roll a button label or step counter into `fields`": the same cell's "Next / Submit and Step N of M are not authored".
15+
2. The `script` example's "function returns values → outputVariable → update_record persists" comment: the prose sentence above it.
16+
3. The "CEL values or literals" comment on `script` `inputs`: Valid-but-silently-wrong #1, which lists `script` `inputs.*` as a value slot.
17+
4. "Do not remove `readonly` instead": objectstack-data's `readonly` bullet ("not by removing `readonly`").
18+
5. The `loop` row's sample envelope: #1's `{ dialect: 'cel', source: '…' }`.
19+
6. "never a reason to write code" in Integrations: the same paragraph's "Never a plugin" and "the app still writing none".
20+
7. References' "Read the source for exact field shapes; never rely on memory": `references/_index.md` ("Read them directly from `node_modules`").
21+
8. "hooks get `ctx.api`": the hook `runAs` paragraph ("that hook's `ctx.api` data operations").
22+
9. When to Use's "(auto-launched, screen, scheduled)" and "record-change": the Flow Types table and the frontmatter description.
23+
24+
The remaining 41 tokens move the file's ceiling 6527 -> 6568 under the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B), pinned at the measurement.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
'@objectstack/plugin-auth': patch
4+
---
5+
6+
feat(plugin-audit): an API key or OAuth access token admitting a request leaves a `credential_use` row in `sys_audit_log`, once per credential per use window
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Credential use left no ledger row naming the credential: the only trace was the credential's own last-use stamp. An audit export or SIEM stream had nothing to read for "which key or token acted as whom, and when".
12+
13+
- **`sys_audit_log.action` gains `credential_use`** (`@objectstack/plugin-audit`). One row per credential per use window, written when the credential's own throttled use stamp lands: `sys_api_key.last_used_at` (the shared key-admission seam, at most once per key per hour, so every door that admits a key counts: REST, the runtime dispatcher and its `/mcp` face, the stdio MCP transport, the storage doors) and `sys_oauth_consent.last_used_at` (an OAuth access token's use on the `/mcp` door, at most once per consent per clock hour). No new timer: a second use inside the window writes no row.
14+
- **The row** names the credential's owner (`user_id`, `actor`), the credential row (`object_name` / `record_id`), the organization it is bound to (`tenant_id`, or none), and in `metadata` the `credential_kind` (`api_key` / `oauth_access_token`), the `credential_id`, the window start (`used_at`) and, for a token, the `client_id`. It never carries a key, a token, a key hash or a key prefix.
15+
- **A `skip_consent` OAuth client** (`@objectstack/plugin-auth`) has no consent row to stamp. Its use is handed to the new `audit` slot member `recordCredentialUse` from the same stamp point and under the same throttle (at most once per client, user and organization per clock hour in each process); the row names the client's `sys_oauth_application` row.
16+
- **Not yet on the row:** the source address and the user agent (`ip_address` / `user_agent` are null). Neither stamp point holds them; they follow in a separate change.
17+
18+
Nothing about which credentials are admitted changes. To read the rows: filter `sys_audit_log` on `action = 'credential_use'`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/plugin-auth': patch
4+
---
5+
6+
feat(spec,plugin-auth): the `auth` service publishes `isOrganizationAdministrator(userId, organizationId)`, the one reading of "is this user an administrator in this organization"
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
- **`@objectstack/spec`: `IAuthService.isOrganizationAdministrator?(userId, organizationId)`**, an optional member: true for any of ADR-0090 D12's three kinds of administrator, tenant-level (the `PLATFORM_ADMIN` rung), organization-level (the `TENANT_ADMIN` rung, from an owner or admin membership) and delegated (a permission set carrying an `adminScope`). A delegated grant that cannot be read counts as an administrator. Read-only and in-process; no route reaches it.
12+
- **`@objectstack/plugin-auth`: `AuthManager.isOrganizationAdministrator`** implements it. It is the method the multi-factor requirement's `administrators` level already asked (formerly the package-internal `isMfaAdministrator`, renamed), so a caller outside plugin-auth, such as an access-policy console previewing who that level would hold, gets the gate's own answer, delegated administrators included. Ask it through the service: `ctx.getService<IAuthService>('auth').isOrganizationAdministrator?.(userId, organizationId)`. Nothing the gate decides changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
Clause-②: yes (widening)
6+
Metadata-protocol: none
7+
8+
An in-environment marketplace install can name the package version to install. `POST /api/v1/cloud-connection/install` now accepts `version` and forwards it to the control plane's install action, which installs that version or refuses it as it does today. Leaving `version` out still installs the latest version, and the request sent to the control plane is unchanged.
9+
10+
A `version` that is not a SemVer 2.0.0 string (for example `latest`, `1.2` or `^1.2.3`) is refused with `400 INVALID_REQUEST` before anything is sent.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
feat(cloud-connection): the install door's declared-rename planner is reachable read-only on a kernel service
6+
7+
Clause-②: yes (widening) — a new read-only kernel service, `marketplace-install-rename-planner` (`INSTALL_RENAME_PLANNER_SERVICE`), registered by `MarketplaceInstallLocalPlugin` beside its install door, and new root exports of `@objectstack/cloud-connection`: the service name, its contract (`InstallRenamePlanner`, `InstallRenamePlanRequest`, `InstallRenamePlan`, `InstallRenamePlannedCarry`) and the result types (`InstallRenameCarry`, `InstallRenameRefusal`, `InstallRenameRefusalReason`). Nothing is narrowed: the install door answers every request as before.
8+
Metadata-protocol: none
9+
10+
A host that installs a package by another route, such as a hosted control plane, can now ask the environment, before anything is written, what an install of a version would do with the fields that version declares `renamedFrom` on:
11+
12+
- `plan({ manifestId, incoming, installed })` takes the incoming and the installed version's bodies as published (`installed: null` for a fresh install) and answers `{ carries, refusals }`: each column the install would carry (`object`, `table`, `from`, `to`, the shape of the door's `renamesCarried`), and each declaration the door would refuse, with the door's reasons (`platform_column`, `live_key`, `claimed_twice`, `both_columns`, `several_old_columns`, `destructive_type`, `index_cannot_follow`, `transport`, `outside_package`) and its words.
13+
- It is the install door's own planning step, not a copy: `POST /api/v1/marketplace/install-local` and the service call the same entry, so a non-empty `refusals` is exactly the door's `422 VALIDATION_ERROR` `details.refusals` for the same versions.
14+
- It writes nothing: no column is renamed, no ledger entry or record is written, and nothing is held for an install. A table that cannot be read rejects the call, as the door answers `503`, never "nothing to carry".
15+
- It is a service of its own, not a member of the install door's `marketplace-install-local` service, so a reader is never handed the install.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/core': patch
3+
'@objectstack/objectql': patch
4+
---
5+
6+
fix(core): an update or upsert import finds its match through the organization's unique index instead of scanning the table once per row
7+
8+
Clause-②: yes (widening) — @objectstack/core gains resolveTenantFieldName, DEFAULT_TENANT_FIELD and isFederatedObject (moved from @objectstack/objectql, which re-exports the same bindings)
9+
Metadata-protocol: none
10+
11+
The match lookup of `runImport` (the `POST /data/:object/import` door, import jobs and a `job.pull` connector sync) queried the key fields alone. Under the `single` tenancy posture the engine adds no organization to a read, so the database could not use the `(organization_id, <key>)` unique index and read the whole table for every row: an upsert of 1,000 rows into a 50,000-row SQLite table ran at 128 rows/s and kept slowing as the table grew. The lookup now carries the caller's organization (the context's `tenantId`, the organization a created row is stamped with) on the target's tenant column, so each row is one index probe (857 rows/s on the same run, flat as the table grows).
12+
13+
The scope only narrows the lookup. It is the key alone, as before, when the context carries no organization, when the target has no tenant column (`tenancy.enabled: false`, `systemFields.tenant: false`, or none declared), for a federated (`external`) object, and when the target's declaration cannot be read. A `job` that declares no `organization` runs with none in its context, so its pull keeps the key-only lookup for now. A key set that names the tenant column keeps the row's own value. Under the `group` posture the match is now the record in the active organization, the one a create from that context writes; it no longer reaches a row of another member organization.
14+
15+
`resolveTenantFieldName`, `DEFAULT_TENANT_FIELD` and `isFederatedObject` move down to `@objectstack/core` so the import runner asks the engine's own tenancy rule. `@objectstack/objectql` re-exports the same bindings, so every existing import keeps working unchanged.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-data `security.md` teaches how a package's position resolves the permission sets it names
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-data/rules/security.md`, section "Positions grant only what they name", now states the rule the security catalog enforces since ADR-0150 E3: a package's position reads each `permissionSets` name as its own package's set, else the one holder in its declared `dependencies` closure plus `sys`. Otherwise the name is refused. Two refusals are taught, each with an example: `outside-closure` (only a package the position's package does not depend on holds the set, or only the environment does, such as a set authored in Setup) and `ambiguous-in-closure` (two holders it reaches; a second package shipping a set name is already refused at install). A refused name still loads; the boot's catalog reference report logs it with every candidate, and the position grants nothing through that name while its other sets still grant. Stored grants, environment-authored positions, administrator overlays of a package position and the `everyone`/`guest` anchors still resolve across the whole environment. `evals/hooks-security-seeds-datasources.json` gains case 19, which requires the position's `permissionSets` entry plus a manifest `dependencies` entry on the set's package and refuses redeclaring the set in the position's package.
11+
12+
The file sat 16 bytes under its token ceiling. One restatement is cut in the same file: the `secret` paragraph's "**Fail-closed:** with no crypto provider, writes throw rather than persist cleartext." (86 B), which survives as "fail-closed (ADR-0100)" in the `secret` row of `rules/field-types.md`. The remainder raises the ceiling under standing ruling 6513306068, letter B: 「A:先削重复,余额按实测提高」. The file goes from 15056 to 15834 bytes, and the ceiling from 3768 to 3959 tokens, pinned at the measurement.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/service-job': patch
3+
---
4+
5+
fix(service-job): a scheduled fire renews its cluster lease while it runs, so a long job no longer starts on a second node
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A scheduled fire takes the cluster lock `job:NAME` with a 60-second lease (`leaseMs`) and used to never renew it. On a deployment with several nodes, a run that outlasted the lease freed the key while still running, and another node's next tick took it and started the same job, so a large sync or report ran on two nodes at once.
11+
12+
`CronJobAdapter` now renews the handle it acquired every `leaseMs / 3` (20 s by default) while the handler runs, through the lock handle's own `renew()`, and stops renewing in the same `finally` that releases the lock. Nothing new is persisted: a node that dies stops renewing and the key frees itself on its lease as before. A run shorter than a third of the lease is never renewed, and `once` jobs behave as before.
13+
14+
If a renewal fails, the run is not cancelled. The adapter logs one `warn` per failure naming the job and the error. While the handle still reports it holds the lock, the next heartbeat tries again; once the lease is lost, renewal stops for that run, and another node's next tick may take the key and start the job there too. The in-process latch from the previous fix still keeps this node from overlapping itself.

0 commit comments

Comments
 (0)