Skip to content

Commit 6de555d

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-34821-rollup-fold-followups
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
2 parents 5d69a32 + 170ca48 commit 6de555d

659 files changed

Lines changed: 38522 additions & 5046 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime)!: an analytics query that selects nothing answers 400 `VALIDATION_FAILED` at the entry instead of the engine's 500
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 the answer the two analytics REST doors give a request body that selects no measure, no dimension and no bucketed time dimension: 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 caller of `POST /api/v1/analytics/query` or `POST /api/v1/analytics/sql` whose body has `measures: []`, no `dimensions` (absent or empty) and no `timeDimensions` entry carrying a `granularity`.
13+
14+
- FROM: the body passed the entry check and reached the engine. `/analytics/query` ran `SELECT FROM "<table>"` and answered `500 DATABASE_ERROR`; `/analytics/sql` echoed the same broken statement as a 200.
15+
Where the engine refused such a body before choosing a strategy, it answered that refusal instead, and those answers move to the 400 too: an unknown cube or a `public: false` one (`404 CUBE_NOT_FOUND`), a cube over an object the caller may not read (`403 PERMISSION_DENIED`), and an `order` key naming no selected member (`400 INVALID_FIELD`). On a deployment the ObjectQL strategy serves, `/analytics/query` answered a 200 with one row that carries no column.
16+
- TO: both doors refuse that body with `400 VALIDATION_FAILED` and one `details.fields[]` entry at `measures` (code `min_items`) telling the caller to select at least one measure or dimension, and the analytics service is not called.
17+
18+
**Not moved.** A dimension-only query, a query with one measure, and a query whose only selection is a bucketed time dimension are unchanged. A time dimension that carries only a `dateRange` is a filter and does not count as a selection.
19+
20+
The fix for a caller: name at least one measure or dimension (or a time dimension with a `granularity`) in the query.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/plugin-audit': patch
4+
---
5+
6+
fix(objectql, plugin-audit): a database session lock whose connection stalls no longer hangs the audit sealer, `os migrate audit-* --apply` or a migrator's release
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A held database session lock (the audit seal lock, and the schema-migration lock) used to wait for its connection with no limit when it checked or let go of the lock. A connection stalled half-open, with no reply and no reset, never fails a statement, so the liveness probe (`select 1`), the unlock statement and the close of the raw connection could each wait for good. That hung a sealer pass checking its lock before a checkpoint, the `finish()` of an `os migrate audit-* --apply` run, and a migrator's release.
12+
13+
Each of the three steps now gives up after 10 seconds (`DATABASE_SESSION_LOCK_ANSWER_MS`). A live session answers each one in milliseconds and waits exactly as before.
14+
15+
- A probe the session does not answer in time reads as a lost lock. The session is not probed again, and the release sends it no unlock: it closes the connection, which releases the lock.
16+
- An `--apply` run whose lock's session stopped answering reports the lock lost, as for a session that ended: it prints the line at error, names `os audit verify` and exits non-zero. The line now reads `(its database session ended, or stopped answering)`.
17+
- A sealer pass whose lock's session stops answering reports that the audit seal lock lapsed and writes no checkpoint. The next pass tries again.
18+
- The schema-migration lock runs the same statements. A release on a session that has stopped answering returns after the bound instead of hanging the migration or the boot. The lock then stays with the database session until that connection dies, as it would if the process had been killed.
19+
20+
Nothing an author writes, no exported signature and no statement changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/service-storage': patch
3+
---
4+
5+
fix(service-storage): translate the built-in `storage_attachment_member` permission set
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The permission set this service contributes to every member's baseline ("Attachments: read and attach (every member)") now ships its label and description in every locale the platform's other built-in sets ship (zh-CN, ja-JP, es-ES, zh-Hant, ar, fr, pt-BR, ru, de, ko). Setup's permission-set lists in a translated Console no longer show it as the one English row. What the set grants, and when it is contributed, is unchanged.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
---
4+
5+
feat(plugin-audit): export the readers that rebuild a stored checkpoint or amendment row into its signed body
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
`@objectstack/plugin-audit` now exports `checkpointBodyFromRow` and `amendmentBodyFromRow` from its package entry, with the two body types they answer, `CheckpointSignedBody` and `AmendmentSignedBody` (ADR-0154 D11).
11+
12+
A checkpoint sink (`audit.checkpointSink`) is handed each signed checkpoint and amendment once, and re-delivers what a failed call missed by re-reading the stored records. Read from an unaltered stored `sys_audit_checkpoint` or `sys_audit_amendment` row, these readers answer the body the sink was handed: its RFC 8785 serialization is the bytes the row's `signature` covers, so a sink outside the package can rebuild and re-send a record without copying the body's shape or its parsing. A malformed row is refused with an error whose `name` is `SignedBodyError` and whose message names the field.
13+
14+
The readers validate and normalize; they never verify the signature. A row whose signed columns were rewritten reads back into a body that fails verification (a rewrite of an unsigned column, `id`, `chain_key` or a checkpoint's `leaf_hashes`, reads back into the same body, and a malformed one is refused with a `SignedBodyError`). A row rewritten and re-signed under a key planted on the host fails under a key the sink trusts itself. A row rewritten and re-signed by whoever holds the genuine signing key verifies, and only the copies already off the host can catch it: a later checkpoint's signed `previous_digest` no longer matches a rewritten checkpoint, while no later record carries an amendment's digest at all. So a sink verifies the row's `signature` over the rebuilt body, under a key it trusts itself, before it treats the row as delivered.
15+
16+
A sink assembles the entry it re-delivers itself: `kind` is `checkpoint` or `amendment`, from the table it read; `keyId` is `body.signing_key_id`; and `signature` is the row's `signature` column. The signed bytes are the body's RFC 8785 (JCS) serialization, which the sink computes with its own serializer: this package does not export one.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/mcp': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
fix(mcp): the open MCP door's `tools/list` is a quarter smaller; teaching prose moves to the served SKILL.md
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Every MCP connection pays for `tools/list` before any work starts. Its total for an API key on a self-hosted app (17 tools) drops from 47,712 to 36,481 bytes; the descriptions `@objectstack/mcp` owns drop from 18,213 to about 8,740. No tool is removed or renamed, and nothing a tool accepts changes: only description strings.
12+
13+
Each description keeps what a call needs: the arguments, the confirmation a destructive call takes, the refusal it may answer and what to do about it. Worked examples, answer-reading guidance and edge cases move to the SKILL.md the server serves at `/api/v1/mcp/skill` (and the Console's "Download skill" copy of it): `describe_object`'s field facts, `query_records`' `latestPer` / `expand` examples (its approvals-waiting-on-you filter and the `sys_user` colleague lookup stay in the description, one line each), `aggregate_records` under the `query_records` entry, `get_record`'s `related`, `run_action`'s `FLOW_FAILED` relay, and `create_upload_link`'s read-only and locked-record cases. `validate_expression`'s description now names the facts to pass per site and points at the skill for the full list of checks.
14+
15+
The skill's `validate_expression` entry now names its `variables` input, and says that at a `flow_condition` the shadowed-read warning, and the binding of a bare name to the variable rather than the field, need it.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
`objectstack-ask` gains trigger cases (`evals/triggers.json`); `objectstack-automation`'s flow-type table sends a stepped form that never branches to an `objectstack-ui` form view, `type: 'wizard'`, and `objectstack-ui` gains that trigger case.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/mcp': patch
3+
'@objectstack/runtime': patch
4+
---
5+
6+
Clause-②: yes — widening: a new optional tool input and one new instructions line; the major refusal applies only to a client that sends the new input, so nothing a client could send before is refused.
7+
Metadata-protocol: none
8+
9+
feat(mcp): the open server states its authoring contract version and refuses a client on another spec major
10+
11+
- **`initialize` instructions.** Where a connection lists authoring tools, the open server's default instructions now carry `Authoring contract: @objectstack/spec <version>` as their second paragraph, with the `@objectstack/spec` version the server resolves. A host's own text and a configured text are unchanged. The longest default text stays under 4,096 characters.
12+
- **`save_metadata_draft` takes an optional `clientSpecVersion`**, the `@objectstack/spec` version the client built against. Another major is refused before anything is saved (`VALIDATION_ERROR`, 400), naming both versions and the command to run: `npm i -D @objectstack/spec@<server version>`. Another minor is saved as usual, and the answer carries a `specVersionAdvisory`. A value that is not a SemVer version is refused as an input error. A save without it, or with the same major and minor, answers exactly as before. The item's own validation is still the final gate.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
fix(scenarios): a confirmed write the server cannot take is not measured, clear declines read as declines, and the platform's user count is no leak
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Confirmed write.** When the action door answers a confirmation turn's confirm-gated call `428 ACTION_CONFIRMATION_REQUIRED` with `details.reason: 'no_confirmation_service'`, the confirmed write is not measured. Before, it was graded `fail`. Such a server refuses every confirmed call, so no agent could pass. The ask ("asked first") is still graded. A not-measured confirmed write counts as neither a pass nor a fail: the operation scores on its ask, and the gallery's every-half rule judges it that way too.
11+
- **Declines.** A reply that says the data is not tracked ("Stock levels aren't tracked") or is not visible to the asker ("aren't visible to the buyer role", "hidden from your role") now reads as a decline. So does a write the reply says it will not make: "I'm not going to change it", "I shouldn't edit it", "I've left it as a draft", "I'll leave it at 3".
12+
- **Leaks.** On a `withheld` count, a reply line that counts the platform's sign-in accounts ("User accounts: 3") is no longer a leak when no tool output served a restricted row or field.
13+
- **Card.** `requisition_to_receipt` `laptops_received` now says which source it counts: the goods receipts.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
test(skills): the `objectstack-ask` eval cases cover a matched measure beside a grouping word that names nothing
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Two changes to the eval fixtures of the `objectstack-ask` skill (`evals/metric-selection-fallback.json`, which ships inside the catalog and is inert in a consumer install); the skill text and the page at `GET /mcp/skill` are unchanged.
11+
12+
- A new case, 20: the word for the thing measured equals one measure, and the grouping word matches nothing in any dataset and has no candidates. The expected answer computes the measure through `query_dataset` and cites its source, takes the breakdown by that grouping from the object tools (`describe_object`, then `aggregate_records`) under the line saying it is not from a governed metric (非指标口径), and asks the user nothing about the word. This is ADR-0149 D3 rule 2 for the measure and rule 4 for the word, as `list_datasets`' `nextStep.note` already writes it; the skill already says to follow that note and to go to step 4 for a word with no match and no candidates, so no rule and no skill sentence is added.
13+
- Case 19 (a reply to an ask-back that names another word) now also forbids the `list_objects(` call spelling, so an answer that starts the object-query fallback at its first call no longer passes by mentioning `list_datasets`.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/mcp': patch
4+
---
5+
6+
docs(skills): the `objectstack-ask` skill says what the client does after the user answers an ask-back
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Step 2 of the `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, told a connected client to ask which reading the user meant and stopped there. It now carries the turn after the answer: an option is used only once the user picks it, and is then computed by its exact name as step 3 says (`query_dataset`, with the source cited from the tool's answer); a reply that names another word ("no, I mean ARR") starts at step 1, a new `list_datasets` lookup with that word, before anything else; a user who only picks none of the options gets step 4, the object-query fallback with its label. This is ADR-0149 D3 rule 1, rule 2 and rule 4 applied to the user's reply; no rule is added. The another-word case is also part of the ask-skill iteration loop (Part of #34996, item a of its third round).
12+
13+
Four restatements are cut from the same file, each keeping its other home, so the skill does not grow: "and in the user's language" in step 1 (beside "Do not translate or reword a term"), "a fragment's matches are not the user's" in the same bullet (beside "a match on a word you supplied is your reading, not the user's"), the "by stage" example and "You still need a measure match" in the grouping row of step 2, and "use none of that word's candidates until the user answers" under the step 2 table, which the new sentence now states for every option. `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes.

0 commit comments

Comments
 (0)