Skip to content

Commit 02481a8

Browse files
committed
Merge origin/main into claude/project-thread-r2ii08
Claude-Session: https://claude.ai/code/session_017ihL2dvnT51fbSebUyE3zW Co-Authored-By: Claude <noreply@anthropic.com>
2 parents 5c6cd1c + 07559ce commit 02481a8

102 files changed

Lines changed: 7580 additions & 301 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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/metadata': patch
3+
'@objectstack/metadata-protocol': patch
4+
---
5+
6+
fix(metadata): a `sys_metadata_history` snapshot no longer stores what a connector save drains from the live row
7+
8+
Clause-②: yes (narrowing)
9+
Metadata-protocol: none
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no authoring door accepts or refuses anything it did not before. Only the body a history row stores for a new write changes; existing history rows are left as they are, so there is nothing for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a reader of raw `sys_metadata_history` rows that expected a connector snapshot to hold an undeclared `auth` key. No door serves one: the history read exit already withheld it.
14+
15+
A connector row stored before the instance-auth shapes went strict can hold a value under an `auth` key its kind does not declare. A save of the served form drains that key from the live row, but a history snapshot is a second copy of the body at rest, and nothing stopped a new snapshot from keeping it: a revert to an older version wrote it into a fresh `revert` snapshot, and a write that no door re-judged did too. Now:
16+
17+
- **Both history writers store the snapshot through one helper**, `historySnapshotBody`, published as `@objectstack/metadata/history-snapshot`: `SysMetadataRepository.put` in `@objectstack/metadata-protocol` (behind the `/meta` save door, publish and revert) and `DatabaseLoader` in `@objectstack/metadata`.
18+
- **What it leaves out is the type's redactor's own answer**: every position named in `notCarriedForwardKeys`, the same answer the save's carry-forward drains by. For a connector those are its undeclared `auth` keys and the undeclared keys inside an object `retryConfig`. Nothing in the helper names a key or a type.
19+
- **Every other body is stored as written, byte for byte.** That covers every type whose redactor marks no such position, and every type with no redactor. The history row's `checksum` keeps naming the live row's stamp, and the history read exit (`redactStoredMetadataRow(s)`) is unchanged.
20+
21+
History rows written before this change are not rewritten here. A one-time scrub follows separately, after a read-only count.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
'@object-ui/console': patch
5+
---
6+
7+
feat(console): Home offers Connect an AI Assistant until the person has connected one; the first-run checklist gains its row
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
- **`@object-ui/app-shell`**: Home shows a card to every signed-in person who has connected nothing yet: they can work in this system from Claude, Doubao and similar AI assistants, as themselves, with one button to Connect an AI Assistant. It is hidden once they have authorized an assistant or hold an API key that still works (read by `useConnectedAccess`, the same read as the Connect page's Connected line), and once they close it (remembered for that person on that browser, like Home's other dismissible items). While the read is out or fails, and where MCP is turned off, it is not shown. `useConnectedAccess` and `connectAssistantPath` are now exported, and the avatar menu item reads its path from `connectAssistantPath`.
13+
- **`@object-ui/console`**: the administrator's first-run checklist gains "Connect an AI assistant", done once that administrator has authorized an assistant or holds a working API key (never from a click), with a link to the page; left out when that cannot be read or MCP is turned off.
14+
- **`@object-ui/i18n`**: `home.connectAssistant.title`, `body`, `action`, `dismiss` and `console.firstRunChecklist.connectAssistant.title`, `todo`, `done`, `action` added in all eleven packs.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
'@objectstack/plugin-audit': patch
4+
---
5+
6+
feat(plugin-auth, plugin-audit): a sign-in the IP allow-list refuses leaves one `login_failed` row in the audit log, bounded per client address
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
A sign-in refused by the ADR-0069 D5 IP allow-list used to leave nothing in `sys_audit_log`: the deployment's list answered `403 IP_NOT_ALLOWED` with only a once-per-process operator line, and an organization's own list refused the session silently. Both now write a `login_failed` row with `metadata.reason: "IP_NOT_ALLOWED"`, `metadata.rule: "ip_allow_list"`, `metadata.endpoint` and `metadata.attempts`, and the client address and user agent in `ip_address` / `user_agent`:
12+
13+
- **The deployment's list** refuses before any account is resolved. Its row names the account when the request's `email` resolves to one (the password sign-in's own account lookup), and is written with no account otherwise. Only `/sign-in/*` endpoints are recorded; a refused session read or sign-out is not a sign-in. The row is written off the response path, so the refusal's status, body and timing do not depend on whether the address names an account.
14+
- **An organization's own list** refuses when the session is created. Its row names the account and the organization (`tenant_id`). A refused switch of the active organization is not a sign-in and writes no row.
15+
16+
The rows are bounded so a scanner cannot flood the table: per client address, in a 10-minute window from its first refusal, only the 1st, 10th and 100th refusal write a row (`attempts` 1, 10, 100); across all addresses, at most 1000 rows per 10-minute window, with one operator `warn` line in a window once the cap drops a row. The bound is held in each server process, so N replicas write up to N times as many rows. No row carries the submitted identifier or the password.
17+
18+
`@objectstack/plugin-audit`'s `AuthSessionAuditEvent.userId` and `@objectstack/plugin-auth`'s `AuthEventAuditSurface` event `userId` are now optional: a `login_failed` with no `userId` is written with `user_id` and `record_id` null (a row about no record, read under the ledger's own grant, platform administrators only when it names no organization). Any other event without a `userId` still writes nothing. `AuthManager.resolveRefusedSignInAccountId(email)` is new: the account a refused sign-in names, used only for that row. A sink registered on the `audit` service slot now receives `login_failed` events with no `userId`, so a custom sink must accept one. The exported `signInFailureEventFor` now answers `null` for `reason: 'IP_NOT_ALLOWED'`, because the door that refused the sign-in writes that row itself.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
feat(cli): `os validate --target ./restriction-profile.json` judges the stack against a target environment's restriction profile
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
A hosted environment differs from a local one only by the restriction profile it publishes (`RestrictionProfileSchema`, `@objectstack/spec/system`). `os validate --target ./restriction-profile.json` reads that profile, parses it with the spec's schema (an invalid profile is refused, naming the schema issue), and refuses every item of the stack the profile forbids — one row per item, each naming the item and the one profile dimension that refuses it:
11+
12+
- `allowCode: false` refuses each object lifecycle hook, each named handler function, each code plugin and the other keys the spec classifies as code, a `script` flow node, and a flow node whose type is not in the spec's built-in node registry (`FlowNodeAction`), which `allowedFlowNodeTypes` cannot name;
13+
- `allowScheduledAutomation: false` refuses each flow of `type: 'schedule'` and each background job;
14+
- `allowedFlowNodeTypes` refuses each flow node, at any region depth, whose built-in type is not listed; `start` and `end` are always allowed.
15+
16+
When the project's `@objectstack/spec` or `@objectstack/skills` is not the version the target runs, the command warns (`--json`: an entry in `warnings` with `package`, `local` and `target`); it does not refuse, and `--strict` does not gate it. Without `--target` the command is unchanged. Only a profile file is accepted: a URL is refused, because no environment publishes its profile at a defined address yet.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
feat(scenarios): the scenario runner drives the Codex CLI (`--driver codex`) and any command that speaks a stdin/stdout driver contract (`--driver external:COMMAND`), and each gallery app page names the driver that ran it
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
The same scenario card can now measure another agent tool. Additive: nothing is removed or renamed.
11+
12+
- **`--driver codex`** (`CodexDriver`): `codex exec --json` on your own ChatGPT plan login. It refuses to start while `OPENAI_API_KEY` or `CODEX_API_KEY` is set or `codex login status` reports anything but a ChatGPT login, and passes `-c forced_login_method="chatgpt"` on every turn. The persona's API key reaches the CLI only in a 0600 profile file under `$CODEX_HOME`, deleted when the turn returns. `--model`, `--author-model`, `--ask-model` and `--author-timeout` apply; `codex exec` has no turn cap, so `--author-max-turns` and `--ask-max-turns` are refused with it.
13+
- **`--driver external:COMMAND`** (`ExternalDriver`, contract `objectstack-scenario-driver/1`): one process per call, the call as JSON on stdin (`info`, `author`, `ask`), the turn as JSON on stdout. A non-zero exit or an answer of another shape is a failed turn with a named reason (`no-result(exit N)`, `invalid-output(…)`). The persona's key is only in a 0600 file whose path the `ask` call names, never on argv, in the environment or on stdin. The package README states the contract.
14+
- **The driver on record**: `DriverInfo` gains `replayOf`, so a replay (`--driver recorded:F`) names the driver and version of the recording it replays. Each exported gallery app page carries a `- Driver:` line with the driver's name and version (`driverText`).
15+
- `ApiBillingRefusedError` takes an optional second argument naming the agent tool and its login command; its default message is unchanged.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
feat(scenarios): `@objectstack/scenarios` is published, with an `objectstack-scenarios` command line: `npx @objectstack/scenarios run` runs the open scenario cards with no checkout of the platform
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
The package was private. It is now released with the `@objectstack/*` packages, at their version, and it carries:
11+
12+
- **A `bin`, `objectstack-scenarios`.** `objectstack-scenarios run [flags]` is the scenario runner (`run-scenarios` in this repository) with the same flags, defaults and refusals: it drives your own local Claude Code login and refuses to start when `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set or the CLI is logged in with an API key. `help` and `version` are the other two commands. The bin runs the built JavaScript in `dist/`.
13+
- **The open card library as package data** (`dist/library/`): the cards of `docs/qa/scenarios/` and the capability areas they are checked against, copied at build time. `run` reads them unless `--cards DIR` names another directory, which is loaded as the overlay. Run records go to `./scenario-runs` unless `--out` says otherwise.
14+
- **The library entries it already had**: the card schema and loader (`@objectstack/scenarios`), the scorer (`./score`, `./score/full`), the runner (`./runner`) and the gallery exporter (`./export`).
15+
16+
It is not an `objectstack` (`os`) subcommand, and nothing in `@objectstack/cli` changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
feat(cloud-connection)!: the marketplace catalog list filters by business function, industry, solution type and maturity on the server, and the `?category=` filter is retired
6+
7+
Clause-②: no (narrowing) — the facets are declared by the published `MarketplaceSearchRequestSchema` (`businessFunctions`, `industries`, `solutionTypes`, `maturity`), so implementing them widens no contract; refusing the retired `?category=` filter, and a facet the catalog cannot answer, narrows what the proxy honours. No export, type or error code of the package is added.
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 or type of the package changes: the catalog list door reads query-string names the spec already declares and refuses one the spec already retired, with the spec's own prescription. Nothing at rest records a catalog query, so there is nothing for a migration to rewrite and no tombstone. -->
11+
12+
**The facet filters.** `GET /api/v1/marketplace/packages` reads `businessFunctions`, `industries` and `solutionTypes`, each one comma-separated value (`?businessFunctions=sales,marketing`), and `maturity`, one value. Values inside one facet are OR-ed, facets are AND-ed with each other, with `maturity` and with `q`, and `limit` / `offset` page the filtered set, so `total` counts every matching listing. A listing that declares no solution type is the spec's default `app`, and one that declares no maturity is `stable`. On the public snapshot path (`OS_MARKETPLACE_PUBLIC_BASE_URL`) the proxy filters and pages the snapshot itself; on the cloud path it forwards the query string to the cloud unchanged, as before.
13+
14+
**BREAKING** accept-set narrowing at the catalog list (`@objectstack/cloud-connection`).
15+
16+
- **Before.** `?category=crm` filtered the public snapshot by the listing's retired `category` column.
17+
- **Now.** `?category=` is refused with `400` and the spec's retirement prescription for `MarketplaceSearchRequest.category` (`retiredCategoryGuidance`, the text a parse of `MarketplaceSearchRequestSchema` gives the same key), on the snapshot and the cloud path alike, before either is asked. A facet value the spec does not declare (`?businessFunctions=crm`), a facet supplied twice (`?industries=retail&industries=logistics`) and a facet naming no value (`?solutionTypes=`) are refused with `400` and `{ "success": false, "error": { "code": "VALIDATION_ERROR", "message" } }` before the snapshot or the cloud is asked; the message names the parameter and the values it takes.
18+
- **Who moves.** Nothing in the workspace sends `?category=` or a facet today; the Console filters the loaded catalog itself. A script still sending `?category=` gets the 400 instead of a filtered list.
19+
20+
**The remedy.** Replace `?category=X` with the facet that says what you mean (`?businessFunctions=`, `?industries=`, `?solutionTypes=`), and send several values of one facet as one comma-separated value.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): the cached `/meta` item read answers the item's own change time as `lastModified`, never the time of the read
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The cached by-name read (`getMetaItemCached`, the default `GET /api/v1/meta/:type/:name`) used to answer `lastModified` as the time of the read, so the `Last-Modified` header changed on every read of an unchanged item while its ETag stayed the same.
11+
12+
- **An item served from a stored `sys_metadata` row** answers that row's `updated_at`: the time of the save or publish that last wrote it. Two reads of the unchanged item answer the same `Last-Modified`; a save or a publish moves it.
13+
- **An item no stored row serves** (a definition shipped in code or loaded from a file) has no known change time. It answers no `lastModified`, and the door sends no `Last-Modified` header.
14+
- **Unchanged.** The ETag, `Cache-Control: private, no-cache` and the `304` on `If-None-Match`. `If-Modified-Since` still never answers a `304`. The by-name read's response envelope is byte-for-byte as before.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/plugin-hono-server': patch
3+
---
4+
5+
fix(plugin-hono-server): a graceful `close()` no longer cuts off a response that has ended but is still being sent to a slow client
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
When `HonoHttpServer.close()` started, Node's own `server.close()` released idle keep-alive connections first thing, and counted a response as done as soon as it had called `end()`, before its bytes were sent. A large response still flushing to a slow client at that moment was destroyed mid-body, so the client got a truncated download. The release of idle connections now waits until no ended response is still flushing; each such response closes its own connection once every byte has been sent, and idle connections are released right after. The drain window still force-closes whatever outlasts it.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/mcp': patch
3+
---
4+
5+
fix(mcp): the record data tools answer a code-less throw as the `/api/v1/data` door does — an undeclared sandboxed hook abort is `HOOK_ABORTED` with the hook's own sentence
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
`query_records`, `aggregate_records`, `get_record`, `create_record`, `update_record` and `delete_record` used to answer a thrown error that carried no `code` with its bare message. For a sandboxed hook body's `throw new Error('…')` that message is the sandbox's debug wrapper, `hook '<name>' threw: Error: …`, so an agent saw the hook's internal name and no code, while `/api/v1/data` answers the same abort `400 HOOK_ABORTED` with the body's sentence alone.
11+
12+
These six tools now classify a code-less throw with the `/data` door's own classifier (`mapDataError`, `@objectstack/types`) and answer `{ "error": { "code", "message", "status" } }`:
13+
14+
- an undeclared sandboxed hook abort: `HOOK_ABORTED`, status 400 (or the 4xx the body declared), the body's sentence;
15+
- a code hook's bare `throw new Error(…)`, a crash, a driver error: `INTERNAL_ERROR`, status 500, message `Internal server error`. The thrown message no longer reaches the agent; it is logged once on the server as a `[5xx]` line, as the HTTP doors log a fault;
16+
- a throw that declared a status and no code (for example the runtime's `503` when no data service is registered): that status, no code, and for a 5xx the message withheld.
17+
18+
An agent that read the bare text of these errors reads `error.message` of the JSON envelope instead, and branches on `error.code`. A thrown error that carries a `code` is answered exactly as before. The other tools (`list_objects`, `describe_object`, `validate_expression`, `list_actions`, `delete_records`, `run_action`, `resume_run` and the file and datasource tools) are unchanged.

0 commit comments

Comments
 (0)