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 bf7e329
Browse filesBrowse the repository at this point in the historyBrowse files
feat(service-analytics): `list_datasets` and `query_dataset` — the dataset AI tools, one definition and one executor (ADR-0149 D2–D4)
7
+
8
+
Clause-②: yes (widening) — new exports `createDatasetTools`, `getDatasetToolDefinitions`, `DATASET_TOOL_DEFAULT_MAX_ROWS`, `matchDatasetTerms` and their types, and three new `AnalyticsService` methods (`datasetTools`, `hasPluginWiredAdmission`, `admitDatasetCatalogEntry`) plus `reportDatasetCatalogDefect`.
9
+
Metadata-protocol: none
10
+
11
+
An AI can now answer a business question from a governed dataset instead of guessing a field on an object.
12
+
13
+
-**Two tools, defined once.**`getDatasetToolDefinitions()` returns the two `AIToolDefinition`s — names, the descriptions that teach the model the selection rule, and the JSON Schemas projected from `@objectstack/spec`'s tool schemas. `AnalyticsService.datasetTools({ loadDatasets, maxQueryLimit?, diagnoseDelegation? })` (or `createDatasetTools`) binds the executor; the MCP bridges and the product AI's registry both call it.
14
+
-**`list_datasets`** lists the saved datasets the caller may query, with each member's label, business description and synonyms at the caller's locale. It asks the same gates a query of the dataset asks: a dataset whose object the caller may not read, or that is not API-exposed, is absent; a member over a field the caller may not read is left out and `membersWithheld: true` says so; a member over an `internal` field is left out for every caller and reported once to the server log. With `terms`, each dataset's `matches` names which word equals which member's name, label (any locale) or synonym, after the dataset schema's own normalization.
15
+
-**`query_dataset`** runs a `DatasetSelection` against one saved dataset through `queryDataset` with the caller's context — no gate added, none skipped. A missing dataset and one the caller may not query both answer `NOT_FOUND`. Rows are capped (50 by default) with `truncated`; the answer carries no SQL and adds a `provenance` block (dataset, measures with their descriptions, dimensions, the caller's `runtimeFilter`) composed from what ran — the model's input cannot set it.
16
+
-**Plugin-wired only.** Both tools refuse with `SERVICE_UNAVAILABLE` / 503 on an `AnalyticsService` built without the admission hooks `AnalyticsServicePlugin` wires, where the exposure gate would warn and pass and the read admission would return silently.
17
+
-**Member descriptions reach the Cube.**`compileDataset` writes a dataset member's `description` onto the Cube member, so `GET /api/v1/analytics/meta` publishes it for a registered dataset cube.
18
+
- The spec liveness ledger moves the four dataset member rows (`synonyms` and `description` on dimensions and measures) from `planned` to `live`.
fix(cli)!: `os serve` asks the multi-node gate about a topology declared by `OS_EXPECT_MULTI_NODE=true`, not only by `OS_CLUSTER_REPLICAS`
6
+
7
+
Clause-②: no (narrowing)
8
+
Metadata-protocol: none
9
+
Skills-docs: `skills/**` names neither spelling of the multi-node declaration. `content/docs/kernel/cluster.mdx` already teaches both spellings as the declaration; its sentence that a gate denial "downgrades … rather than failing" is corrected in this diff: with a declared topology the split-brain guard refuses the boot.
10
+
11
+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, export, type or stored shape changes. The narrowing is a boot refusal keyed to environment variables an operator sets, so there is nothing for a metadata migration to rewrite and no tombstone. -->
12
+
13
+
**BREAKING** for a deployment that runs `os serve` with a remote cluster driver (`OS_CLUSTER_DRIVER` other than `memory`), declares multi-node only as `OS_EXPECT_MULTI_NODE=true`, and registers no multi-node gate.
14
+
15
+
A multi-node topology has two spellings, `OS_CLUSTER_REPLICAS` greater than 1 and `OS_EXPECT_MULTI_NODE=true`. With no gate registered, the gate refuses a declared multi-node topology, because multi-node is a licensed capability. `os serve` used to ask the gate with `OS_CLUSTER_REPLICAS` alone, so a topology declared only as `OS_EXPECT_MULTI_NODE=true` reached the gate as undeclared and booted the remote driver multi-node with no gate. The same deployment spelled `OS_CLUSTER_REPLICAS=2` was already refused.
16
+
17
+
After the upgrade both spellings answer the same way. `os serve` reads the declaration through `declaresMultiNode` from `@objectstack/service-cluster`. A declaration with no count is asked as 2 nodes, the smallest multi-node count. With no gate registered it prints `[cluster] multi-node not authorized (…)`, drops the remote driver, and the split-brain guard refuses the in-process fallback, so the boot stops.
18
+
19
+
FROM a multi-replica deployment that sets `OS_EXPECT_MULTI_NODE=true` over a remote driver with no gate TO either:
20
+
21
+
- register a multi-node gate (install the distribution that carries it), which authorizes the topology, or
22
+
- drop `OS_EXPECT_MULTI_NODE` (and keep `OS_CLUSTER_REPLICAS` unset or 1) to run single-node.
23
+
24
+
A single-node boot, a boot declared as `OS_CLUSTER_REPLICAS`, and a boot whose registered gate admits the topology are unchanged.
25
+
26
+
When a gate that caps the node count admits fewer nodes than that 2, the licensed-cap advisory no longer prints a replica count the operator did not write. It names `OS_EXPECT_MULTI_NODE=true`, says what the licence admits, says the cap is advisory and every replica still joins, and asks the operator to run at most that many replicas (or set `OS_CLUSTER_REPLICAS`) or raise the limit. The advisory for a count declared as `OS_CLUSTER_REPLICAS` is unchanged.
docs(skills): objectstack-data `security.md` teaches that a package's sharing rule resolves its queue recipient from its own package
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
`skills/objectstack-data/rules/security.md` now states the rule the sharing plugin enforces since ADR-0150 E4: a declared sharing rule's `sharedWith: { type: 'queue', value }` reads the name as its own package's queue, else the one holder in the package's declared `dependencies` closure plus `sys`, else (no package or environment item declares the name) an organization's `sys_queue` row. Three refusal codes are taught, each with an example: `outside-closure` (the only holder is a package the rule's package does not depend on, or an environment-authored item), `ambiguous-in-closure` (two dependencies hold the name) and `ambiguous-in-environment` (the holder the rule reaches, its own package or one dependency, and a non-dependency both hold it). A refused rule grants no one new and is warned as `RESOURCE_CONFLICT`; it loads, so nothing earlier tells the author. `evals/hooks-security-seeds-datasources.json` gains case 18, which requires the queue recipient plus a manifest `dependencies` entry on the queue's package and refuses redeclaring the queue in the rule's package.
11
+
12
+
The file sits at its token ceiling, so the new bullet (446 bytes) is paid for by these cuts in the same file (459 bytes; the file goes from 15069 to 15056 bytes):
13
+
14
+
-`(PermissionSetSchema.rowLevelSecurity)` after "permission set / profile" (41 B); the same sentence names `rowLevelSecurity` on a permission set.
15
+
- "(the tenant wall still applies)" in the RLS default-deny sentence (32 B); the Layer 0 bullet says the wall is AND-composed ahead of all business RLS.
16
+
- The sentence that a legacy SQL-style `=` / `IN (...)` predicate still compiles through a deprecated bridge (98 B). This is not a restatement: the file now teaches canonical CEL only.
17
+
- The four "(for `IN`)" notes in the `current_user.*` table (42 B); the predicate list above it spells `field in current_user.ARRAY`.
18
+
- The membership-key section intro, shortened to "Declare the set on the roster object, not one policy per record." (80 B); the section heading and the "Choose by" bullet's "a named record → a membership key" carry the rest.
19
+
- "(`isDefault` sets)" after the `everyone` baseline in the Positions section (19 B); the `isDefault: true` bullet defines that baseline.
20
+
- The admin-only recipe's `tenancy` comment "not a tenant object → Layer 0 contributes nothing" (55 B); the blockquote below it explains the key.
21
+
- The blockquote's "it is the half that holds however permissive the grants" (59 B); the `requiredPermissions` paragraph calls it an AND-gate, strictest-wins over field grants.
22
+
- "(`@objectstack/plugin-security`)" after `sys_user_permission_set` (33 B); a package pointer an author never writes.
23
+
24
+
The `(definePermissionSet)` example comment and the field-lock recipe docs link stay.
0 commit comments