Skip to content

Commit f531a26

Browse files
committed
Revert "chore: version packages (#2954)"
This reverts commit ca30acd.
1 parent 95e0bb8 commit f531a26

220 files changed

Lines changed: 1570 additions & 5606 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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/runtime': minor
4+
'@objectstack/metadata-protocol': minor
5+
'@objectstack/objectql': patch
6+
'@objectstack/rest': patch
7+
'@objectstack/plugin-hono-server': patch
8+
---
9+
10+
feat(discovery): honest capabilities — standardized stub/fallback marker + realtime route honesty (ADR-0076 D12/A1.5 framework slice, #2462)
11+
12+
**Spec** — new service self-description marker for honest discovery
13+
(ADR-0076 D12): `SERVICE_SELF_INFO_KEY` (`__serviceInfo`),
14+
`ServiceSelfInfoSchema` / `ServiceSelfInfo`, and `readServiceSelfInfo()`,
15+
which also normalizes plugin-dev's legacy `_dev: true` flag to
16+
`{ status: 'stub', handlerReady: false }`. A registered service that is a
17+
stub / dev fake / degraded fallback self-identifies via this marker; a fully
18+
real service carries no marker.
19+
20+
**Runtime + metadata-protocol** — both discovery builders
21+
(`HttpDispatcher.getDiscoveryInfo` and the protocol shim's `getDiscovery`)
22+
now honor the marker instead of hardcoding `status: 'available',
23+
handlerReady: true` for every registered service. Dev stubs report `stub`,
24+
the ObjectQL analytics fallback reports `degraded` (it keeps serving — no
25+
`/analytics` 404), and consumers can finally trust
26+
`status === 'available'` / `handlerReady === true`.
27+
28+
**Realtime honesty fix** — discovery no longer advertises a
29+
`/realtime` route or `websockets: true`: `service-realtime` is an
30+
in-process pub/sub bus, no dispatcher branch or plugin mounts any
31+
`/realtime` HTTP surface, so the advertised route always 404'd. The
32+
registered service now reports `status: 'degraded', handlerReady: false`
33+
with no route (clients using the SDK are unaffected — it falls back to the
34+
conventional path, which behaves exactly as before). Also corrects the
35+
advertised realtime provider from the nonexistent `plugin-realtime` to
36+
`service-realtime`.
37+
38+
**REST (A1.5)** — the REST layer's protocol dependency is narrowed from the
39+
`ObjectStackProtocol` god-union to the new `RestProtocol =
40+
DataProtocol & MetadataProtocol` slice (exported from
41+
`@objectstack/rest`), per the ADR-0076 D9 incremental narrowing guidance.
42+
Type-level only; no runtime change.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/lint': patch
3+
'@objectstack/plugin-audit': patch
4+
---
5+
6+
ADR-0085 #2548 follow-ups surfaced by the real-backend browser pass:
7+
8+
- **lint**: new `field-group-shadowed` warning in `validate-semantic-roles` — a
9+
declared fieldGroup whose every visible member is hoisted into the detail
10+
highlight strip (or is the record title) renders on forms but silently never
11+
on detail pages (detail bodies hide the first 4 highlightFields). Warning
12+
tier, same as the other semantic-role rules.
13+
- **plugin-audit**: feed/audit summaries ("Created … / Deleted … / Updated …")
14+
now name the object by its display label ("Semantic Zoo") instead of its API
15+
name ("showcase_semantic_zoo") — these strings render verbatim in the record
16+
Discussion feed and Setup dashboards. Falls back to the API name when the
17+
object definition isn't resolvable. Existing stored rows are unchanged.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): retire the stale `renderViaSchema` forward-reference now that objectui#2546 landed (ADR-0085 PR4 follow-up, #2548)
6+
7+
The `ObjectSchema` source comment forward-referenced `renderViaSchema`
8+
retiring "together with the legacy monolith render path" — a promise about
9+
work that had not yet shipped. That path, and the `detail.renderViaSchema`
10+
kill-switch that was its only steering wheel, were removed in objectui#2546
11+
(ADR-0085 PR4). The comment now records the completed state with a breadcrumb
12+
to that PR instead of a forward reference, closing the cleanup #2546 flagged.
13+
14+
Comment-only change; no type, schema, or runtime behavior is affected.

.changeset/adr-0087-completion.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/cli': minor
4+
'@objectstack/runtime': minor
5+
'@objectstack/service-package': minor
6+
'create-objectstack': minor
7+
---
8+
9+
feat(protocol): complete ADR-0087 — load-seam handshake, chain backfill 12–15, release artifacts (#2643)
10+
11+
Closes the remaining ADR-0087 gaps (see the ADR's as-built Addendum):
12+
13+
- **P0 load seams (D1).** The protocol handshake now runs on the boot-time
14+
durable-package rehydration path (`@objectstack/service-package` refuses an
15+
incompatible `sys_packages` row with the structured `OS_PROTOCOL_INCOMPATIBLE`
16+
diagnostic and keeps booting) and on `AppPlugin` for code-defined stacks
17+
(fail-fast before the manifest is decomposed). `objectstack lint` gains
18+
`protocol/missing-engines-range` (warning + fix-it) and the
19+
`create-objectstack` blank template stamps `engines: { protocol: '^<major>' }`
20+
(re-stamped at version time by `scripts/sync-template-versions.mjs`) — the
21+
two ends of the grandfathering ratchet.
22+
- **Chain backfill (D2/D3).** `MetadataConversion.retiredFromLoadPath`
23+
implements the load-window's second half (retired entries replay only via
24+
`migrate meta` / fixture CI). Steps 12–15 land: the `api.requireAuth` flip
25+
(semantic), the ADR-0090 wave (3 retired conversions + 5 semantic TODOs), the
26+
`BookAudience` rename (retired conversion), and the ADR-0089 visibility
27+
unification (`visibleOn`/`visibility``visibleWhen` as LIVE load-window
28+
conversions) + the `.strict()` flip (semantic). The protocol-11
29+
`compactLayout``highlightFields` rename is backfilled as a retired step-11
30+
conversion. `migrate meta --from 10` now reaches protocol 15.
31+
- **Release artifacts (D4).** `spec-changes.json` is generated from the
32+
registries (`gen:spec-changes`, CI drift-checked), ships in the npm artifact
33+
together with `api-surface.json`, and is attached to each `@objectstack/spec`
34+
GitHub Release with `added[]`/`removed[]` filled from the api-surface diff
35+
against the previously published release. The upgrade guide
36+
(`docs/protocol-upgrade-guide.md`) is generated from the same registries and
37+
CI drift-checked — a projection that cannot drift.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-automation': minor
4+
'@objectstack/connector-rest': minor
5+
'@objectstack/connector-openapi': minor
6+
'@objectstack/connector-mcp': minor
7+
---
8+
9+
feat(connectors): ADR-0096 — provider-bound declarative connector instances materialized at boot (#2977)
10+
11+
Declarative `connectors:` stack entries used to be **descriptor-only** (#2612):
12+
registered as metadata but never dispatchable, the platform's one dead metadata
13+
surface. An entry may now name a **`provider`** — an installed generic executor
14+
(`openapi` / `mcp` / `rest`) — and the automation service **materializes** it
15+
into a live, dispatchable connector at boot. AI can now wire an integration as
16+
pure metadata and a flow `connector_action` calls it end-to-end.
17+
18+
- **Schema (`@objectstack/spec`).** `ConnectorSchema` gains `provider`,
19+
`providerConfig`, and `auth` (a `credentialRef`-based instance-auth shape —
20+
`ConnectorInstanceAuthSchema` — that references credentials, never inlines
21+
them); `authentication` now defaults to `{ type: 'none' }` so a provider-bound
22+
instance need not author it (loosening — existing connectors are unaffected).
23+
`DeclarativeConnectorEntrySchema` (used by `stack.zod.ts`) rejects inline
24+
secrets, orphan `providerConfig`/`auth`, and authored `actions`/`triggers` on a
25+
provider-bound entry. A new `integration/connector-provider.ts` defines the
26+
provider-factory contract as pure types.
27+
28+
- **Engine + boot (`@objectstack/service-automation`).** The engine adds a
29+
connector-provider registry (`registerConnectorProvider`/`getConnectorProvider`)
30+
and origin-tags registered connectors. At boot the service resolves each
31+
provider-bound entry — looking up the factory, resolving `auth.credentialRef`
32+
via a pluggable `CredentialResolver` (open-tier default: environment
33+
variables), and registering the materialized connector. Boot **fails loudly**
34+
for an unknown provider, invalid `providerConfig`, an unresolvable
35+
`credentialRef`, or a name conflict with a plugin-registered connector (no
36+
silent precedence).
37+
38+
- **Providers (`connector-rest` / `connector-openapi` / `connector-mcp`).** Each
39+
plugin registers a provider factory in `init()` reusing its existing
40+
generator/adapter API. Plugin options are now **optional**: with none the
41+
plugin contributes only its provider factory; with instance options it also
42+
registers a hand-wired connector (back-compat). `connector-openapi` adds a
43+
`ConnectorOpenApiPlugin`.
44+
45+
Open tier: static auth (`none`/`api-key`/`basic`/`bearer`) with `credentialRef`
46+
resolved from env vars. Managed vaulting, OAuth2 refresh, and per-tenant
47+
connection lifecycle remain the enterprise tier (ADR-0015) — an enterprise host
48+
injects a vault-backed `CredentialResolver` with no change to the materialization
49+
path.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-automation': minor
4+
'@objectstack/connector-openapi': minor
5+
'@objectstack/cli': minor
6+
---
7+
8+
feat(connector-openapi): resolve `providerConfig.spec` from a package-relative file path (#3016, ADR-0096 follow-up)
9+
10+
ADR-0096's canonical example authors an OpenAPI-backed instance as
11+
`providerConfig: { spec: './billing-openapi.json' }`, but the landed `openapi`
12+
provider factory only accepted an inline document object or an http(s) URL.
13+
The spec union is now complete: **inline object | file path | remote URL**.
14+
15+
- **`@objectstack/spec`.** `ConnectorProviderContext` gains an optional
16+
host-injected `loadPackageFile(relativePath)` capability (pure type): reads a
17+
UTF-8 file resolved against the declaring stack/package root, confined to
18+
that root. `undefined` on hosts without a filesystem.
19+
20+
- **`@objectstack/service-automation`.** New `packageRoot` plugin option (the
21+
base for relative file refs; defaults to `process.cwd()`) and an exported
22+
`createPackageFileLoader(packageRoot)` that implements the confinement
23+
guard — absolute paths and `..`-escaping paths are rejected — with lazy
24+
`node:fs`/`node:path` imports so non-Node hosts only fail if a file ref is
25+
actually dereferenced. The materializer injects the capability into every
26+
provider factory's context. Failures follow the existing reconcile policy:
27+
**fatal at boot, entry skipped on reload**.
28+
29+
- **`@objectstack/connector-openapi`.** A string `providerConfig.spec` that is
30+
not an http(s) URL is now read via `ctx.loadPackageFile` and parsed as an
31+
OpenAPI JSON document (clear errors for missing/unreadable files, unparseable
32+
JSON, and hosts without package file access).
33+
34+
- **`@objectstack/cli`.** `serve`/`dev` pass the project folder (the
35+
`objectstack.config.ts` directory) as the automation service's `packageRoot`,
36+
mirroring how the standalone sqlite default is anchored.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/service-automation': minor
3+
---
4+
5+
feat(connectors): ADR-0096 runtime re-materialization of declarative connectors (#2977 follow-up)
6+
7+
Provider-bound declarative `connectors:` instances (ADR-0096) previously
8+
materialized only at boot — a connector published from Studio while the server
9+
ran did not become dispatchable until a restart. `materializeDeclaredConnectors`
10+
is now a **reconcile** run both at boot and on `metadata:reloaded`:
11+
12+
- **Add** newly-declared instances, **tear down** removed / newly-`enabled:false`
13+
ones (calling their `close`, e.g. an MCP connection), and **re-materialize**
14+
only instances whose signature — a stable hash of `provider` + `providerConfig`
15+
+ `auth` + identity — changed. An unchanged MCP instance is never needlessly
16+
reconnected on an unrelated metadata reload.
17+
- **Boot stays fatal** ("fail loudly"): unknown provider / invalid providerConfig
18+
/ unresolvable credentialRef / name conflict aborts startup. **Reload is soft**:
19+
the same problems are logged and the offending entry skipped, so a bad publish
20+
never crashes a running server; a changed instance's old connector keeps
21+
serving until its replacement materializes successfully.
22+
23+
Also: `ConnectorDescriptor` (served by `GET /api/v1/automation/connectors`) now
24+
carries an `origin` field (`'plugin' | 'declarative'`), so a designer can
25+
distinguish a materialized declarative instance from a plugin-registered
26+
connector.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-automation': minor
4+
'@objectstack/connector-mcp': minor
5+
---
6+
7+
feat(connectors): degrade + retry declarative instances whose upstream is unreachable (#3017)
8+
9+
ADR-0097 kept every declarative-connector materialization failure fatal at
10+
boot. That is right for configuration faults (unknown provider, invalid
11+
`providerConfig`, unresolvable `credentialRef`, name conflict) but wrong for
12+
*operational* ones: a `provider: 'mcp'` instance must contact its MCP server
13+
(`tools/list`) to materialize, and a transient network blip aborted the whole
14+
app boot.
15+
16+
- **spec**: a provider factory can now throw
17+
`ConnectorUpstreamUnavailableError` (code `CONNECTOR_UPSTREAM_UNAVAILABLE`,
18+
structural guard `isConnectorUpstreamUnavailable`) to mark a failure as
19+
"upstream temporarily unreachable — degrade and retry" instead of fatal.
20+
- **service-automation**: the reconcile degrades such an instance in both boot
21+
and reload modes: it registers an action-less husk (`state: 'degraded'` +
22+
`degradedReason` on the `GET /connectors` descriptor) so the instance is
23+
visible instead of silently missing — or, on a changed-config
24+
re-materialization, keeps the old connector serving. A `connector_action`
25+
against a degraded instance fails with the reason and a "retries
26+
automatically" pointer. Degraded instances retry on an exponential backoff
27+
(5s → 5min, reset by config edits) and on every `metadata:reloaded`
28+
reconcile; recovery swaps the husk for the live connector atomically.
29+
Reconcile runs (boot / reload / retry timer) are now serialized.
30+
- **connector-mcp**: the `mcp` provider classifies connect / `tools/list`
31+
failures as upstream-unavailable; transport-shape validation stays a plain
32+
(fatal) throw.
33+
34+
Configuration faults remain loud boot failures — the carve-out is only for the
35+
unavailable marker.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/connector-mcp': minor
3+
---
4+
5+
feat(connector-mcp)!: policy-gate declarative stdio transports — default-deny + host allowlist (#3055)
6+
7+
A declarative `provider: 'mcp'` entry with a stdio transport spawns a local
8+
child process **from metadata** — which a runtime Studio publish can introduce.
9+
Declarative stdio is now **denied by default**; hosts opt in deliberately:
10+
11+
```ts
12+
new ConnectorMcpPlugin({ declarativeStdio: ['my-mcp-server'] }) // command allowlist
13+
new ConnectorMcpPlugin({ declarativeStdio: true }) // allow any (full trust)
14+
```
15+
16+
Behavior change: a declarative stdio instance that materialized before now
17+
fails as a **configuration fault** (fatal at boot / skipped on reload) with an
18+
actionable opt-in message, and is never classified upstream-unavailable — a
19+
security rejection must not be retried into existence. `http` transports and
20+
**hand-wired** connectors (plugin instance options / `createMcpConnector`) are
21+
unaffected. This is the security precondition for shipping `connector-mcp` in
22+
default presets (#3056); see ADR-0097 §"Declarative stdio policy" and
23+
ADR-0024 §4.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/service-storage': minor
3+
---
4+
5+
feat(attachments): authenticated, parent-scoped downloads for attachments files (#2970)
6+
7+
Closes item 2 of #2970. The storage download endpoints (`GET /storage/files/:fileId`
8+
and `/files/:fileId/url`) were anonymous capability URLs — anyone holding a
9+
`fileId` could mint a download without a session or any access check.
10+
11+
For `scope === 'attachments'`, non-`public_read` files, both endpoints now gate
12+
on a new `authorizeFileRead` seam: `401 AUTH_REQUIRED` without a session, `403
13+
ATTACHMENT_DOWNLOAD_DENIED` when the caller is neither the file's owner nor able
14+
to READ a record the file is attached to (parent-derived, resolved through the
15+
full caller context via `resolveAuthzContext`), and otherwise a **short-lived**
16+
signed URL (`downloadTtl`, default 300s). Non-attachments files (field files,
17+
avatars, org logos — embedded in `<img src>` which cannot carry a bearer token)
18+
keep the stable anonymous capability URL, and bare kernels/tests without the
19+
seam wired stay open (back-compat).

0 commit comments

Comments
 (0)