Skip to content

Commit 1b3817a

Browse files
Merge branch 'main' into claude/project-thread-w9aa30
2 parents 5255cb6 + 895dd43 commit 1b3817a

209 files changed

Lines changed: 6776 additions & 866 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): a config that fails to load is no longer reported as "Compile failed"
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
When the `os compile` child that `os dev`, `os start`, `os serve --dev` and `os environments bind --build` run exits non-zero, the closing line said `Compile failed — fix errors above …`. The parent sees only the child's exit status, so the same line followed a refusal raised while `objectstack.config.ts` loads (for example a licence or key-management refusal), and an operator went looking for a code error.
11+
12+
The line now says what is true of every way the child fails, a syntax error, a refusal thrown at load or a refusal that prints and exits: `objectstack.config did not load or compile — the reason is printed above; fix it before …`, with each command's own tail (`starting dev server`, `starting the server` with the `--artifact` hint, `starting the dev server.`, `binding`). The `os dev` watch recompile's failure line reads `✗ objectstack.config did not load or compile (Nms)` in place of `✗ compile failed (Nms)`, with the compile output after it as before. Nothing classifies the failure: exit statuses, error codes and the text the child prints are unchanged.
13+
14+
A script that matched `Compile failed` in this output should match `did not load or compile`.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/driver-mongodb': patch
3+
---
4+
5+
fix(driver-mongodb): refuse a non-UTC date-bucket timezone on a direct `aggregate()` call instead of answering UTC buckets
6+
7+
Clause-②: no (narrowing)
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 export changes shape. What moves is one runtime answer of MongoDBDriver.aggregate() to a direct caller: a non-UTC timezone with a date bucket is refused instead of answered with UTC buckets. No stored row, registry key or authored value changes, so there is nothing for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** for a direct `MongoDBDriver.aggregate()` call that carries a non-UTC `timezone` with a `dateGranularity` group-by item: it used to answer UTC buckets and now answers `NOT_IMPLEMENTED` / 501. It ships `patch` because it is a non-protocol breaking change (AGENTS.md Post-Task Checklist step 3): no metadata author writes a driver query, so `Metadata-protocol` is `none`, and the engine path never sends this driver a zone.
13+
14+
`MongoDBDriver.aggregate()` now refuses a query that carries a non-UTC `timezone` (`DriverAggregateQuery.timezone`) together with a `dateGranularity` group-by item, answering `NOT_IMPLEMENTED` / 501 before anything is sent to the server. It used to ignore the zone and return UTC calendar buckets with no word. This driver does not declare `supports.zonedDateBucketing`, so `engine.aggregate` never sends it a zone and buckets such a query in memory; only a caller that goes around the engine is affected. No `timezone`, or `UTC`, buckets in UTC as before, and a `timezone` on a query with no date bucket is still ignored.
15+
16+
Fix for a direct caller: route the query through `engine.aggregate`, or drop the `timezone` and accept UTC buckets.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/core': patch
4+
'@objectstack/lint': patch
5+
'@object-ui/core': patch
6+
---
7+
8+
feat(spec, core, ui): `{current_iso_week}` defaults a week-keyed filter to the current ISO week
9+
10+
Clause-②: yes (widening: the closed filter-placeholder vocabulary gains one token)
11+
Metadata-protocol: added
12+
13+
A dashboard whose rows carry a text week key (`cost_week: '2026-W47'`) could only default its week filter to a fixed week, which went stale the next Monday. Write the placeholder instead and the filter opens on the current week each time:
14+
15+
```ts
16+
globalFilters: [
17+
{ field: 'cost_week', label: 'Week', type: 'text', defaultValue: '{current_iso_week}' },
18+
],
19+
```
20+
21+
- It resolves to the ISO-8601 week key of today, `YYYY-Www`: Monday-start weeks, week 1 is the week that holds the year's first Thursday, and the year is the ISO week-numbering year, so 2027-01-01 is `2026-W53` and 2025-12-29 is `2026-W01`. "Today" is the day in the workspace time zone, on the server and in the browser alike; the label is the one the analytics week bucket already uses.
22+
- It is a period key, not a date. It lives in its own closed list, `PERIOD_KEY_TOKENS`, beside `DATE_MACRO_TOKENS` and not inside it, so a date filter default and a calendar `initialDate` still refuse it. `classifyFilterToken` answers a new kind, `period-key`, and `isKnownFilterToken` knows it, so lint, flow filter operands and the server resolver accept it wherever a filter placeholder is accepted. A consumer that switches exhaustively on `kind` gets a compile error until it handles the new kind.
23+
- The server resolves it in `resolveFilterTokens`; the browser resolves it in `resolveFilterPlaceholders` and in the dashboard filter defaults (every filter type except `date` and `dateRange`), so the filter box opens showing the resolved key. A literal `2026-W47` default keeps working and stays fixed.
24+
- Every filter and default written before parses and resolves exactly as before. Only the whole value is a placeholder: `'week {current_iso_week}'` is left as written. A near spelling such as `{currentIsoWeek}` is still refused as an unknown token.
25+
- Use it only on a field that stores week keys. On a date, datetime or time field the placeholder is refused (`INVALID_FILTER` / 400), as the literal key is; filter those with the `this_week` preset or `{current_week_start}` / `{current_week_end}`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/lint': patch
4+
---
5+
6+
fix(lint): `ai-skill-tool-unresolved` resolves every tool the MCP door registers for a skill offered over MCP, and says why when a skill kept out of MCP names one
7+
8+
Clause-②: yes (widening) — `ai-skill-tool-unresolved` stops warning on eight tool names the MCP door registers, and `@objectstack/spec/system` gains the export `MCP_DOOR_TOOL_NAMES`; nothing that resolved before is reported
9+
Metadata-protocol: none
10+
11+
The MCP door in `@objectstack/mcp` registers record, file, action, federation and dataset tools, and offers a skill bound to them over MCP. The lint rule knew only the two file tools, so a skill bound to `aggregate_records`, `delete_record`, `delete_records`, `list_actions`, `run_action`, `resume_run`, `list_remote_tables` or `import_object` was warned that the agent cannot call it, and `os lint --strict` failed.
12+
13+
`@objectstack/spec/system` now exports `MCP_DOOR_TOOL_NAMES`, every tool the door registers on a bridge carrying every optional member under a grant naming every scope. For a skill offered over MCP (`mcpPrompt` not `false`), the rule resolves every name in it. `@objectstack/mcp` has a test that keeps this list equal to what the door registers, so a tool added to or renamed at the door fails there until the list follows it. Some door names (`get_record`, `query_records`, `describe_object`, …) are cloud registrations as well and stay in `PLATFORM_PROVIDED_TOOL_NAMES`; the door's names do not join `PLATFORM_TOOLS_BY_PACKAGE`, so each group there stays the exact set one cloud package registers. `MCP_FILE_TOOL_NAMES` stays as it was and is part of the new list.
14+
15+
A skill kept out of MCP (`mcpPrompt: false`) runs only in the in-product agents, which do not have the door tools no cloud package registers, so naming one there is still reported. The warning now says so: "Tool "run_action" resolves only for a skill offered over MCP, and this skill sets `mcpPrompt: false`, so the in-product agents it runs in have no such tool". The fix line offers dropping `mcpPrompt: false` or removing the name. A trailing-wildcard entry that matches only door tools gets the same verdict.
16+
17+
`os explain ai-skill-tool-unresolved` names `MCP_DOOR_TOOL_NAMES` as the third source and adds that a skill which runs an app action binds `action_<name>` (or `action_*`) rather than `run_action`: the MCP door serves that entry through `run_action`, and the in-product agents call the action tool itself.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
fix(service-analytics): a derived dataset measure whose operands are all tenant-currency amounts carries the request's tenant currency
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A dataset `sum` over a `currency` field in `dynamic` mode (the default) already labels its result column with the request's tenant currency (`localization.currency`). A derived `sum` or `difference` over such measures did not: its column carried no `currency`, so it rendered as a bare number beside the plain sums it was built from (a project's actual cost as labor plus expense, for example). Its column now takes the tenant currency too, on `POST /analytics/dataset/query` and on the dataset draft preview alike.
11+
12+
A derived measure counts as an amount in the tenant's currency only when every operand is one: an amount aggregate (`sum`, `avg`, `min`, `max`) over a `dynamic` currency field with no `currency` of its own, or a derived `sum` / `difference` of such measures. Unchanged:
13+
14+
- A `ratio` or `product` of tenant amounts is no amount and stays bare.
15+
- A derived measure that mixes a tenant amount with a `fixed` code, an explicit measure `currency`, a record-mode amount or a `count` stays bare, whichever operand comes first.
16+
- A derived `sum` / `difference` over one `fixed` code still carries that code, and a derived measure's own `currency` still wins.
17+
- With no tenant currency on the request, the column carries none, as the plain sum under it does.
18+
19+
No metadata key, accepted value or default changes; no compile-time guard moves.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
feat(scenarios): the gallery export writes each app as a package a customer can install and try (listing text, business-function facet, sample data), and the gallery check refuses an app with no sample data
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
The exporter now adds three things to each app's `source/`. It adds them after the run is scored, so the AI's build is never graded on them, and it never writes them into the run's own project.
11+
12+
- `objectstack.manifest.json` gets the card's listing text and facet. `displayName` and `description` are the card's English title and one-sentence requirement. The Chinese pair goes under `translations.zh`. `businessFunctions` is the card's own list, primary first. The build's other keys are kept.
13+
- `src/sample-data.json` holds the card's seed rows as stack `data:` datasets: one per object, named with the app's namespace, keyed on the card's row id (`externalId: 'id'`). Lookup values name row ids of the same load. A user-handle field (`run.userHandleFields`) is left out of every row, because its value names a user of the run's own environment, and the app README says which field was left out.
14+
- `objectstack.config.ts` gets one import line and `data: gallerySampleData` as the first property of its default-exported `defineStack({ … })` literal. Every other byte stays as the AI wrote it. The export is refused, with the reason, in four cases: the default export is not such a literal, the literal already declares `data:` or spreads a value, a seeded object is missing from the build, or the build already wrote `src/sample-data.json`.
15+
16+
Measured on `travel_expense`: the blank scaffold's `objectstack.config.ts`, with the recorded build's objects and the 757 seed rows added this way, passes `objectstack validate`. A dataset naming an object the build lacks is refused there ("Seed data references object … which is not defined in objects"), which shows the validator reads the imported file.
17+
18+
`export-gallery --check` has a new finding, `app-sample-data`. It reports an app whose `source/` has no `src/sample-data.json`, a file that is not a non-empty list of datasets the spec's `SeedSchema` accepts (each with at least one record), or a `source/objectstack.config.ts` that does not import it. A gallery tree written by an earlier exporter has no sample-data file, so the check reports each of its apps until the next refresh exports them again. The check writes nothing and deletes no app.
19+
20+
`installModes` and `solutionType` are not written yet: `installModes: ['unmanaged']` makes `defineStack` refuse an app that carries code `plugins` or `capability` items, which an app on the standard scaffold does. `typescript` moves from a dev dependency to a dependency. The exporter loads it, with a dynamic import, only when it edits a config.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/mcp': patch
3+
---
4+
5+
feat(mcp): `query_records` and `aggregate_records` answer a `source` block, with a finished `line` in the caller's language
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
A successful `query_records` or `aggregate_records` answer now carries a top-level `source` key on both MCP doors (HTTP and stdio): the block `ObjectQuerySourceSchema` (`@objectstack/spec/ai`) already types, composed from the read the tool ran. It names the object, the caller's `where` exactly as sent (`filter`), the aggregations and group keys, the caller's own `orderBy` with the cut beside it (`limit`), the lookups read through `expand` (`related`), a one-record-per-group reading over one key (`latestPer`), and `records` where the read established it: a page read's counted total, or an uncut aggregate's bare `count` summed over every group, never after a cut. `scope` is `visible_to_you` on every call: these doors ask no row-filter question, and the read runs under the caller's permissions and row-level security.
11+
12+
`source.line` is that source as one sentence of at most 280 characters, in the caller's language (en, zh-Hans, zh-Hant, ja; the shared picker `pickSentenceLocale` over the bridge's `userTextLocales`, the ladder `ifNotRecorded` reads), naming the object and its fields by the labels the caller's served definition shows and by the caller's own names otherwise. The tool descriptions tell the model to quote it as the source of a figure. Before this, an aggregate answer came back as a bare number.
13+
14+
No existing key changes. An error answers no block; `get_record` answers none, since its answer is the record itself. A read the schema cannot state truthfully (one record per group over several keys), or a block the schema refuses, is answered without the block. Each call now reads the caller's served object definition once for the labels; a bridge without `servedObjectDefinitionOf` gets machine names, and one without `userTextLocales` gets English.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/i18n': patch
3+
---
4+
5+
feat(i18n): a count family for capability drafts in the pending-changes summary
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Every locale pack adds `preview.changes.typeCount.capability` (and its plural forms), so the console's pending-changes summary reads "2 capabilities" (`能力 2` in Chinese) instead of the raw type name when a publish carries capability drafts.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'create-objectstack': minor
3+
---
4+
5+
feat(create-objectstack): the blank scaffold lists no connector plugins until the app declares a connector
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A new project's `objectstack.config.ts` no longer lists `ConnectorRestPlugin`, `ConnectorOpenApiPlugin` and `ConnectorMcpPlugin`, and its `package.json` no longer depends on the three connector packages. A plugin is code, so an app that lists any plugin installs managed only. The scaffold's own plugin list therefore kept every AI-built app from installing as an unmanaged copy, such as a marketplace trial.
11+
12+
To use a connector, install its provider package and add it to `plugins:`, for example `plugins: [new ConnectorRestPlugin()]`. The template's README and the comment in `objectstack.config.ts` show how. The install contract is unchanged: a stack that lists plugins still validates for managed install only.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/metadata-protocol': minor
4+
'@objectstack/objectql': minor
5+
'@objectstack/plugin-security': patch
6+
'@objectstack/cli': patch
7+
---
8+
9+
feat(security): an unmanaged install copies an app's capabilities, renamed with the copy
10+
11+
Clause-②: yes (widening)
12+
Metadata-protocol: added
13+
14+
An app that gates an action on its own capability can now install as an unmanaged copy (`installModes: ['unmanaged']`). Before, `capability` was code-only (`allowRuntimeCreate: false`), so the validator refused the mode for any app that declared one, and the install door had no channel to write the copy's capabilities.
15+
16+
- **`capability` is runtime-creatable.** Its `DEFAULT_METADATA_TYPE_REGISTRY` entry is now `allowRuntimeCreate: true`, and overlays stay closed (`supportsOverlay: false`, `allowEnvironmentOverlay: false`). A body is judged by `CapabilityDeclarationSchema`, as before.
17+
- **The save door refuses two names.**
18+
- A platform capability's name (`manage_users`, `setup.access`, every name in `PLATFORM_CAPABILITIES`) answers `422 NAMESPACE_CONFLICT`. An environment item under that name would shadow the platform's definition, because the registry answers its bare slot first.
19+
- A name an installed package's capability holds answers `422 NAMESPACE_CONFLICT`, naming the holder. A capability holds one name per deployment, the same rule permission sets and positions follow.
20+
- **The environment catalog holds capabilities.** `ENVIRONMENT_HELD_SECURITY_CATALOG_TYPES` is `['position', 'permission', 'capability']`. A package that ships a capability name the environment already authored is refused at boot, as a position or permission-set name is. `os migrate security-catalog-overlays`, the remedy that refusal names, lists and deletes such a capability row too (`capability` and `capabilities` spellings).
21+
- **An unmanaged copy renames its capabilities.** When the copy takes a new namespace, a capability whose name starts with the source namespace (`<ns>.` or `<ns>_`) is renamed into the copy's namespace. Every reference is rewritten with it: a permission set's `systemPermissions` (list or per-operation map), an object's or action's `requiredPermissions`, and a quoted `current_user.hasCapability('<name>')` in a predicate. There the object-name rename never touches a name the package declares, so a capability named after a renamed object has one name in the copy; a token the package does not declare follows a renamed object as before. An unprefixed capability keeps its name. A renamed capability that collides with another package's capability refuses the install, naming both. Install again under another namespace.
22+
- **Duplicating a package refuses a shared gate.** `duplicatePackage` keeps its source installed, so a capability it cannot rename (no source prefix, or a copy name the package already declares) is refused, and so is every copied item that grants, requires or tests for it, each at its own name in `failed[]`.
23+
- **The `everyone` anchor excuses only a declaration that carries a package.** The check that refuses a high-privilege permission set bound to `everyone` excuses the tokens an app declared itself. It now counts only declarations bound to a package (`_packageId`), as ADR-0090 D5 rules: an app's shipped capabilities, an unmanaged copy's, and one saved into a writable package. A capability saved with no package excuses nothing. What bounds a saved declaration is the two refusals above: a platform capability is never excused, and a name a package declares cannot be declared again. A name nobody declares can be declared once, by a `manage_metadata` holder, inside a writable package.
24+
- **The gate is unchanged.** It still matches capability names. The copy's action is gated on the copy's capability: a holder of the copy's permission set passes, and a holder of only the source's set does not.

0 commit comments

Comments
 (0)