From 3a888c121770cf6391bba5bfd4d72d61519d4880 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:22:27 +0000 Subject: [PATCH] chore(release): version packages --- .changeset/d1-handoff-writes.md | 11 --- .changeset/d1-read-retry.md | 5 - .changeset/deps-bundle-330-334.md | 8 -- .changeset/es-review-355.md | 6 -- .changeset/i18n-intake-gate.md | 5 - .changeset/i18n-machine-translated-label.md | 5 - .changeset/i18n-swedish.md | 6 -- .changeset/mcp-pending-changes.md | 5 - .changeset/preview-media-urls.md | 8 -- .changeset/rfc45-step8-0-gate.md | 16 --- .changeset/rfc45-step8a-listings.md | 14 --- .changeset/rfc45-step8b-structured-data.md | 16 --- .changeset/rfc45-step8c-hops.md | 25 ----- .changeset/rfc48-step2-store.md | 17 ---- .changeset/rfc48-step3-api.md | 17 ---- .changeset/rfc48-step4-mcp.md | 16 --- .changeset/rfc48-step5-hosts.md | 19 ---- .changeset/scrolly-phone-step.md | 6 -- .changeset/selfhost-chrome.md | 12 --- .changeset/selfhost-observability.md | 13 --- .changeset/selfhost-smtp.md | 11 --- .changeset/single-factor-warning.md | 5 - .changeset/site-build-status-order.md | 6 -- .changeset/sqlite-file-lock.md | 6 -- .changeset/studio-guest-login.md | 5 - .changeset/studio-remembered-accounts.md | 5 - packages/agent-runtime/CHANGELOG.md | 15 +++ packages/agent-runtime/package.json | 2 +- packages/analytics/CHANGELOG.md | 15 +++ packages/analytics/package.json | 2 +- packages/api/CHANGELOG.md | 95 ++++++++++++++++++ packages/api/package.json | 2 +- packages/astro-renderer/CHANGELOG.md | 73 ++++++++++++++ packages/astro-renderer/package.json | 2 +- packages/cli/CHANGELOG.md | 102 ++++++++++++++++++++ packages/cli/package.json | 2 +- packages/cloudflare/CHANGELOG.md | 90 +++++++++++++++++ packages/cloudflare/package.json | 2 +- packages/comments/CHANGELOG.md | 21 ++++ packages/comments/package.json | 2 +- packages/core-contracts/CHANGELOG.md | 41 ++++++++ packages/core-contracts/package.json | 2 +- packages/core-ts/CHANGELOG.md | 87 +++++++++++++++++ packages/core-ts/package.json | 2 +- packages/create-cloudhal/CHANGELOG.md | 22 +++++ packages/create-cloudhal/package.json | 2 +- packages/mcp-server/CHANGELOG.md | 87 +++++++++++++++++ packages/mcp-server/package.json | 2 +- packages/release-verify/CHANGELOG.md | 17 ++++ packages/release-verify/package.json | 2 +- packages/schedules/CHANGELOG.md | 16 +++ packages/schedules/package.json | 2 +- packages/storage/CHANGELOG.md | 36 +++++++ packages/storage/package.json | 2 +- 54 files changed, 731 insertions(+), 282 deletions(-) delete mode 100644 .changeset/d1-handoff-writes.md delete mode 100644 .changeset/d1-read-retry.md delete mode 100644 .changeset/deps-bundle-330-334.md delete mode 100644 .changeset/es-review-355.md delete mode 100644 .changeset/i18n-intake-gate.md delete mode 100644 .changeset/i18n-machine-translated-label.md delete mode 100644 .changeset/i18n-swedish.md delete mode 100644 .changeset/mcp-pending-changes.md delete mode 100644 .changeset/preview-media-urls.md delete mode 100644 .changeset/rfc45-step8-0-gate.md delete mode 100644 .changeset/rfc45-step8a-listings.md delete mode 100644 .changeset/rfc45-step8b-structured-data.md delete mode 100644 .changeset/rfc45-step8c-hops.md delete mode 100644 .changeset/rfc48-step2-store.md delete mode 100644 .changeset/rfc48-step3-api.md delete mode 100644 .changeset/rfc48-step4-mcp.md delete mode 100644 .changeset/rfc48-step5-hosts.md delete mode 100644 .changeset/scrolly-phone-step.md delete mode 100644 .changeset/selfhost-chrome.md delete mode 100644 .changeset/selfhost-observability.md delete mode 100644 .changeset/selfhost-smtp.md delete mode 100644 .changeset/single-factor-warning.md delete mode 100644 .changeset/site-build-status-order.md delete mode 100644 .changeset/sqlite-file-lock.md delete mode 100644 .changeset/studio-guest-login.md delete mode 100644 .changeset/studio-remembered-accounts.md diff --git a/.changeset/d1-handoff-writes.md b/.changeset/d1-handoff-writes.md deleted file mode 100644 index 641d594a..00000000 --- a/.changeset/d1-handoff-writes.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@cloudhal/core-ts": patch -"@cloudhal/storage": patch ---- - -Graph writes caught while D1 moves (#324) are no longer lost or applied twice. When a write gets D1's transient error (a graceful handoff in a self-host cluster, a deploy or an eviction on Cloudflare), the store reads its aim back: -- the new content hash, or the operation's `op_guards` row, means it applied and is reported as a success; -- the node still at the revision it read means the write was lost, and it runs once more; -- anything else is a `ConflictError`, as for any concurrent change. - -This covers single-node CAS writes, every `OpBatch` operation, site updates and publishes, entry and page deletes, snapshots and scheduled release publishes. `@cloudhal/storage` exports `isTransientD1Error`. diff --git a/.changeset/d1-read-retry.md b/.changeset/d1-read-retry.md deleted file mode 100644 index e770a74c..00000000 --- a/.changeset/d1-read-retry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/storage": patch ---- - -`D1Driver` retries a read-only `get` or `all`, about 2 s in all, when D1 lost the request in transit ("Network connection lost", a Durable Object reset). This happens when D1's object moves: on Cloudflare after a deploy or an eviction, and in a self-host cluster on every graceful handoff (RFC-0047 §7). The cluster failover test (#290) found it as one 503 page during a SIGTERM. Writes and batches are never retried, because a lost write may still have been applied. `readRetryDelaysMs: []` turns the retries off. diff --git a/.changeset/deps-bundle-330-334.md b/.changeset/deps-bundle-330-334.md deleted file mode 100644 index 3d8626ad..00000000 --- a/.changeset/deps-bundle-330-334.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@cloudhal/api": patch -"@cloudhal/core-ts": patch -"@cloudhal/schedules": patch -"@cloudhal/cli": patch ---- - -Dependency updates: hono 4.13.23 (`@cloudhal/api`), temporal-polyfill 1.0.8 (`@cloudhal/core-ts`, `@cloudhal/schedules`), and in the starter that `cloudhal init` copies, Astro ^7.4.13 and Tailwind CSS ^4.3.5 (`tailwindcss` with `@tailwindcss/vite`). The Astro peer range of `@cloudhal/astro-renderer` and `@cloudhal/cli` stays `^7.4.0`. diff --git a/.changeset/es-review-355.md b/.changeset/es-review-355.md deleted file mode 100644 index b7b9b9d4..00000000 --- a/.changeset/es-review-355.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@cloudhal/astro-renderer": patch -"@cloudhal/cli": patch ---- - -Spanish status pages read the way a native speaker decided (#355): impersonal phrasing instead of tú, and "Disponible de nuevo: {time}" for the return time. Studio's Spanish uses the same reviewer's wording for the consent screen, connected agents, collections and listings. diff --git a/.changeset/i18n-intake-gate.md b/.changeset/i18n-intake-gate.md deleted file mode 100644 index 977b37df..00000000 --- a/.changeset/i18n-intake-gate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/cli": patch ---- - -Studio's Turkish and French keep every argument English shows: Turkish permission notices name the roles that may act ("Yalnızca Editörler ve üstü …"), the delete dialog names what it deletes, and the menu delete dialog names the menu; French taxonomy empty states use the taxonomy's plural name. Translations from Weblate are now checked the same way before they reach Studio. diff --git a/.changeset/i18n-machine-translated-label.md b/.changeset/i18n-machine-translated-label.md deleted file mode 100644 index 0bb87abb..00000000 --- a/.changeset/i18n-machine-translated-label.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/cli": patch ---- - -Studio's language menus now say which languages are machine translations: they are listed under "Machine translated", and while Studio speaks one, a "Machine translated · help review" link beside the menu leads to the translation project (#112, ADR-0034 amendment). diff --git a/.changeset/i18n-swedish.md b/.changeset/i18n-swedish.md deleted file mode 100644 index 0cf7764d..00000000 --- a/.changeset/i18n-swedish.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@cloudhal/cli": patch -"@cloudhal/astro-renderer": patch ---- - -Swedish (`sv`, Svenska): Studio and the site status pages in Swedish, an AI translation awaiting review on Weblate. Studio's language menu lists it under "Machine translated". diff --git a/.changeset/mcp-pending-changes.md b/.changeset/mcp-pending-changes.md deleted file mode 100644 index c2fb47bb..00000000 --- a/.changeset/mcp-pending-changes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/mcp-server": minor ---- - -New read-only MCP tool `pending_changes` (`site:read`, #279): before `publish`, an agent sees what publishing the current state would change against the live version, without snapshot ids. It returns the counts, the same lines the person is asked to approve, every node (up to 200) with the top-level fields that changed (any node kind; publish bookkeeping left out), and `approval`: whether the caller's `publish` would go live at once, wait for a person (with the reason, and in `auto` mode the rule that stopped it) or be refused. It runs the same gate as `publish` (the policy's decision, the own-only rule, `auto` mode's low-risk check), now shared in `publish-gate.ts`. `diff_node` now compares fields as canonical JSON, so key order no longer reads as a change. diff --git a/.changeset/preview-media-urls.md b/.changeset/preview-media-urls.md deleted file mode 100644 index 3c150797..00000000 --- a/.changeset/preview-media-urls.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@cloudhal/core-ts": patch -"@cloudhal/astro-renderer": patch -"@cloudhal/api": patch -"@cloudhal/cloudflare": patch ---- - -Studio previews show their images again when Studio and the site are on different hosts (#383). Preview HTML pointed blob images at the site's `/media/…` path, which only the site's host serves; Studio answered it with its own HTML. Previews now name a short-lived signed URL that Studio serves itself, `GET /api/sites/:siteId/preview-media/:assetId/.?v=…&exp=…&sig=…`: HMAC-SHA256 over the site, asset, SHA-256 prefix and expiry, with a key derived (HKDF) from `CLOUDHAL_PREVIEW_SECRET` or else `BETTER_AUTH_SECRET`. The signature is the credential, because the sandboxed preview sends no session cookie and has an opaque origin (the route answers `Cross-Origin-Resource-Policy: cross-origin`). Expiries are bucketed to 6 hours, so re-renders keep the same URL and the browser cache hits. Covers, section images, `asset:` references, Markdown `/media/…` images and drafts' never-published uploads are all rewritten; external images keep their URL. A taken-down file answers 410. The playground routes these URLs to their session without the cookie. diff --git a/.changeset/rfc45-step8-0-gate.md b/.changeset/rfc45-step8-0-gate.md deleted file mode 100644 index 92617631..00000000 --- a/.changeset/rfc45-step8-0-gate.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@cloudhal/core-ts": minor -"@cloudhal/cloudflare": minor -"@cloudhal/astro-renderer": minor -"@cloudhal/api": minor -"@cloudhal/mcp-server": patch -"@cloudhal/cli": patch ---- - -RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). - -- **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. -- **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. -- **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. -- **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. -- **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. diff --git a/.changeset/rfc45-step8a-listings.md b/.changeset/rfc45-step8a-listings.md deleted file mode 100644 index 14cd0c08..00000000 --- a/.changeset/rfc45-step8a-listings.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@cloudhal/core-ts": minor -"@cloudhal/astro-renderer": minor -"@cloudhal/api": patch -"@cloudhal/mcp-server": patch ---- - -RFC-0045 rollout step 8a: listings by reference (see the RFC's "Amended in 8a"). - -- **A reference field can be a listing field.** Its conditions are `eq`, `ne`, `in`, `set` and `unset` on translation group ids, with a multiple select's meaning for a multiple reference (contains, contains any). There is no ordering and no `all`. The values come from `resolveFields`, so a translation filters by its original's non-localized reference. -- **Member ids read as their group's** in every query path: the store's `queryContentEntries` (API `GET …/entries?where=`, MCP `list_entries`), `contentList` sections (stored as group ids on page writes) and the renderer's `queryEntries`/`contentList`. -- **Rebuild:** `entry_list_values` rows hold reference group ids now, and the list fingerprint's format is 3, so every listed collection is rebuilt once by `lists.backfill` (Cloudflare) or at start-up (`rebuildListValues`, Node). Until then listings answer from the in-memory evaluator. -- **Studio:** a content list condition on a reference picks its entries with the entry picker. A collection list shows a reference column as titles and filters it by a chosen entry. The "Listing fields" warning now names repeaters only. -- **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so reference listing fields and conditions on them stay refused (`reference_listings_unsupported`) until the release that enables step 8. diff --git a/.changeset/rfc45-step8b-structured-data.md b/.changeset/rfc45-step8b-structured-data.md deleted file mode 100644 index 8d568810..00000000 --- a/.changeset/rfc45-step8b-structured-data.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@cloudhal/core-contracts": minor -"@cloudhal/core-ts": minor -"@cloudhal/astro-renderer": minor -"@cloudhal/api": patch -"@cloudhal/mcp-server": patch ---- - -RFC-0045 rollout step 8b: structured data from references (see the RFC's "Amended in 8b"). - -- **Contract:** a fifth structured-data source, `ReferenceValueSource` (`{ "kind": "reference", "field": "venue", "property": "title" }` or `"targetField": "city"`), and the `ReferenceValueProperty` enum (`title`, `url`, `summary`). -- **Event.location from a venue entry:** a preset can read the entry a single, one-target reference field names. That is the member the page shows (its language, the site's fallback, published and not gated), with a translation's non-localized fields read from its original. Without one, its properties are left out, and a missing required one keeps the `BlogPosting`. -- **Checks:** `structured_data_invalid` when the source names a field that is not such a reference, gives both or neither of `property`/`targetField`, or reads a card property or target field the path does not take. Field operations on the target's field see the presets that read it (rename follows, remove and an unfitting retype are refused). -- **Previews:** MCP `preview_structured_data` and Studio's preview read the working copy's published referenced entries. -- **Studio:** the structured-data card offers "From Venue: Title", "From Venue: City" and the like. -- **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so a write that adds a reference source is refused (`reference_listings_unsupported`) until the release that enables step 8. diff --git a/.changeset/rfc45-step8c-hops.md b/.changeset/rfc45-step8c-hops.md deleted file mode 100644 index b3c3b2d1..00000000 --- a/.changeset/rfc45-step8c-hops.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"@cloudhal/core-contracts": minor -"@cloudhal/core-ts": minor -"@cloudhal/astro-renderer": minor -"@cloudhal/cloudflare": minor -"@cloudhal/mcp-server": patch -"@cloudhal/cli": patch ---- - -RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). - -- **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. - - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. - - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. - - No venue means no match, `ne` and `unset` included. - - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. -- **Contract:** `FieldCondition.field` accepts one dot. -- **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. -- **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: - - reference listing fields and `contentList` conditions on them (8a); - - `ReferenceValueSource` presets (8b); - - one-hop conditions. - - A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. -- **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. diff --git a/.changeset/rfc48-step2-store.md b/.changeset/rfc48-step2-store.md deleted file mode 100644 index 4e1637d8..00000000 --- a/.changeset/rfc48-step2-store.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"@cloudhal/storage": minor -"@cloudhal/core-ts": minor -"@cloudhal/api": patch ---- - -RFC-0048 rollout step 2 adds the store side of agents' signed upload links. There are no agent tools or REST route yet; those come in steps 3 and 4. - -- **Migration `0035_agent_uploads`.** This additive migration adds `purpose`, `attempts`, `complete_by`, `received` and `asset_id` to `media_uploads`, plus an index on `(site_id, state)`. Studio's tickets become `purpose = 'studio'` rows and behave as before. Studio's ticket queries now read only those rows. -- **`store.uploads` (`AgentUploads`).** - - `open` creates a row bound to one file: size, type and a required SHA-256. It is created only while the key (10) and the site (50) are under their open limits and the site quota can hold the declared bytes beside the uploads in progress. - - `receive` is the link's PUT. It claims the row with a CAS before reading any byte and stages exactly the declared bytes. Images are buffered and stripped; other files are streamed. A refused PUT reopens the row, up to three attempts. - - `complete` inserts the asset node in one guarded `batch()`. The batch requires the row to be `received` before `completeBy` and the blob to be stored, and anchors the row's `completed` state and the lease release on the new node's hash. Repeating the call returns the same asset. - - `stats` returns the pending uploads, for the daily limit. -- **Staging is split out.** `ingestAsset` and `ingestAssetStream` now run staging (`media/stage.ts`: lease, put, verify, `stored`) and then completion (node and lease release). The agent link runs the two steps separately and holds the lease until `completeBy`. Unfinished uploads are then collected by the existing media garbage collection. -- **Blob leases are never shortened.** `leaseBlob` keeps the longer of the old and new lease. -- **New invariant codes**, with their HTTP statuses: `checksum_mismatch` and `size_mismatch` (400); `upload_used`, `upload_expired` and `too_many_attempts` (410); `too_many_uploads` and `upload_pending` (409). diff --git a/.changeset/rfc48-step3-api.md b/.changeset/rfc48-step3-api.md deleted file mode 100644 index 567cb652..00000000 --- a/.changeset/rfc48-step3-api.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"@cloudhal/api": minor -"@cloudhal/cloudflare": patch ---- - -RFC-0048 rollout step 3 adds the API side of agents' signed upload links. Links are not minted over MCP yet; `create_upload` and `complete_upload` come in step 4. - -- **The PUT route.** `PUT /api/sites/:siteId/assets/agent-uploads/:uploadId?sig=…` is the only route with the new `upload-link` requirement (RFC-0005 I15 as amended). The route guard reads no session for it, and `test/route-scopes.test.ts` pins it to that one route. The handler: - 1. checks the signature against the row; - 2. refuses a credential that belongs to another agent (`not_your_upload`) and ignores cookies; - 3. checks the headers before reading any byte: `Content-Encoding`, `Content-Type`, the exact `Content-Length`, and the type's cap; - 4. lets the store claim the row and stage the bytes. - - It answers §5.2's codes. Accepted PUTs are audited as `asset.upload-received`, without the link. Other methods answer 405 with `Allow: PUT`, and reveal nothing. -- **Signing.** Agent links are signed with a key derived under `cloudhal agent upload v1` (`signAgentUpload`, `verifyAgentUpload`, `agentUploadPath`). Studio's tickets keep `cloudhal upload ticket v1`, so neither kind of link verifies on the other's route. -- **`uploadSecret` (`CLOUDHAL_UPLOAD_SECRET` on the admin Worker, at least 32 characters).** It signs both kinds of upload link, ahead of the preview secret and the MCP state key, so it can rotate on its own. Requests can read whether the secret is configured or per process (`uploadSecretShared`), for step 4's capability flag. -- **The playground** refuses the new route (`uploads`). diff --git a/.changeset/rfc48-step4-mcp.md b/.changeset/rfc48-step4-mcp.md deleted file mode 100644 index 1a3e9a3b..00000000 --- a/.changeset/rfc48-step4-mcp.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@cloudhal/mcp-server": minor -"@cloudhal/api": patch ---- - -RFC-0048 rollout step 4: agents can now upload large files from disk without base64. - -- **`create_upload`** (scope `asset:upload`, gated like `upload_asset`) takes a file's exact size, type and SHA-256 and returns a 10-minute PUT link with a ready `curl` line. When the library already holds those bytes, it answers `status: "existing"` with the asset instead. -- **`complete_upload`** turns the received bytes into the asset and answers as `upload_asset` does. It asks for no second approval: it is refused in `plan` and free in `manual`. Calling it again returns the same asset. -- **Schemas.** Optional inputs accept `null`. The output follows the strict profile: every key is always present, `null` where it does not apply. -- **`get_mode.uploads`** reports `{signedUrl, maxBytes, linkSeconds}`. Links are off on stdio `cloudhal mcp`, without a shared signing secret, or with `media.agentUploads: false`. The per-file cap is `media.agentUploadBytes`: 25 MB by default, at most 100 MB. The server instructions mention `create_upload` only where links are on. -- **Refusals** (`upload-hints.ts`) use existing tool codes with a `details.reason`: `upload_cap`, `unsupported_type`, `checksum_required`, `too_many_uploads` (10 open per key, 50 per site), `quota_exceeded`, `signed_upload_unsupported`, `upload_pending`, `upload_failed`, `too_many_attempts`, `upload_not_found` and `upload_expired`. Each comes with the agent's next step. -- **The daily limit** (100 files, 500 MB) now counts open uploads with their declared bytes. -- **Audit rows** name the upload and never hold the link. -- **The README tool table** is regenerated. -- **The API** passes `/mcp` the link signer, whether the secret is shared, and the configured origin. Links point at the configured origin, else at the `/mcp` request's. diff --git a/.changeset/rfc48-step5-hosts.md b/.changeset/rfc48-step5-hosts.md deleted file mode 100644 index 855fb8ad..00000000 --- a/.changeset/rfc48-step5-hosts.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -"@cloudhal/core-contracts": minor -"@cloudhal/release-verify": patch -"@cloudhal/cli": minor -"@cloudhal/cloudflare": patch ---- - -RFC-0048 rollout step 5 finishes agents' signed upload links on every host. - -- **Compatibility (`@cloudhal/release-verify`, `@cloudhal/core-contracts`):** verifiers before 0.12 refuse 0.12+ manifests; update the verifier with the CLI. The release manifest's `SecretName` gains `CLOUDHAL_UPLOAD_SECRET`, which 0.12+ manifests list for the admin Worker, and an older verifier rejects the unknown value. The new schema still verifies older bundles. Portable copies of the schema need the new `release-manifest` fingerprint (RFC-0046, amended). -- **`CLOUDHAL_UPLOAD_SECRET`:** - - `cloudhal deploy` generates it once into `.cloudhal/deploy/secrets.json` (0600) and gives it to the admin Worker. It signs upload tickets and agents' upload links ahead of the preview secret, so it can rotate on its own. - - The release manifest's `SecretName` gains it, an additive contract change. - - On self-host it is optional, with `_FILE` supported. `cloudhal selfhost secrets` generates it for new installations; when unset, the preview secret signs; a value shorter than 32 characters stops the image at start. The compose file passes it through. -- **`cloudhal.json` `media.agentUploads: false`** turns the links off, and **`media.agentUploadBytes`** caps a file (25 MB by default, at most 100 MB). - - They become the admin Worker's vars `CLOUDHAL_AGENT_UPLOADS` and `CLOUDHAL_AGENT_UPLOAD_BYTES`. Self-host takes the same vars from its environment, and `cloudhal studio` reads them from the project. - - The release key table classes both as `deploy` keys, so `deploy --release` accepts any value. -- **Studio's Activity** labels `create_upload`, `complete_upload` and `asset.upload-received` in every language. Languages other than English are drafts awaiting review. -- **A guide**, `docs/guides/agent-uploads.md`, covers the flow, the settings, the secret and its rotation, keeping `?sig=` out of proxy access logs and `wrangler tail`, and body size limits. The self-host guide and the threat model now list the new settings and the mitigations. diff --git a/.changeset/scrolly-phone-step.md b/.changeset/scrolly-phone-step.md deleted file mode 100644 index ab93d996..00000000 --- a/.changeset/scrolly-phone-step.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@cloudhal/astro-renderer": patch -"@cloudhal/cli": patch ---- - -Scroll stories on phones (#288): where the theme stacks a `Scrolly`'s sticky panel above the steps, the current step is now the one the reader sees below the panel, not the one passing beneath it. The motion module (now `/_cloudhal/motion.5.js`, with `motion.4.js` as an alias) measures the panel and puts the line in the middle of the screen below it; beside the steps (wide screens) the band is unchanged. It also writes the panel's tallest height to `--ch-scrolly-panel-h`, which the blog starter uses as the stacked panel's `min-height`, so a shorter card no longer pulls the steps up. Themes created before this get the new line on upgrade without a CSS change; copying the one-line `min-height` rule from the starter's `motion-scroll.css` adds the steadier panel. diff --git a/.changeset/selfhost-chrome.md b/.changeset/selfhost-chrome.md deleted file mode 100644 index e15ba171..00000000 --- a/.changeset/selfhost-chrome.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@cloudhal/cli": minor -"@cloudhal/cloudflare": minor -"@cloudhal/mcp-server": minor -"@cloudhal/core-ts": patch ---- - -`render_page` on self-host through an optional Chrome sidecar (#292). -- **The setting.** `CLOUDHAL_BROWSER_URL` (Chrome's DevTools port) gives the admin Worker a `BROWSER_CDP` binding. -- **The driver.** `@cloudhal/cloudflare`'s new `devtoolsRenderer` drives it with the shared `cdpSession`: one browser context per render, and the shared browser is never closed. -- **What it opens.** `render_page` opens only the page's signed preview link. With `RenderDeps.origin` (`CLOUDHAL_RENDER_ORIGIN`, default `http://cloudhal:8788`) it opens the link at that private origin, so a site without a domain renders too. `@cloudhal/core-ts` gains `previewUrlAt`. -- **The recipes.** The compose file gains a `chrome` profile: no port, and a network shared with Cloudhal only. The Helm chart gains `chrome.*` values: a Deployment, a Service and a NetworkPolicy. diff --git a/.changeset/selfhost-observability.md b/.changeset/selfhost-observability.md deleted file mode 100644 index 15dafef8..00000000 --- a/.changeset/selfhost-observability.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@cloudhal/cloudflare": minor -"@cloudhal/core-ts": minor -"@cloudhal/astro-renderer": minor -"@cloudhal/storage": minor -"@cloudhal/cli": minor ---- - -Observability for self-host (#293; RFC-0047 §7a). -- **Traces.** `OTEL_EXPORTER_OTLP_ENDPOINT` takes `https://` too, and `OTEL_EXPORTER_OTLP_HEADERS` adds a backend's headers. Every export carries `x-cloudhal-instance` and `x-cloudhal-version` headers for the collector to turn into resource attributes. -- **Metrics.** The admin Worker gains `GET /api/metrics` (Prometheus text). It is off unless `CLOUDHAL_METRICS_TOKEN` is set, and then answers only that bearer token. It covers requests of the admin and site Workers (the site's through `/__cloudhal/metrics`), publish durations, scheduler lag and health, and store errors. -- **Supporting changes.** `D1Driver` takes an `onError` hook, and `@cloudhal/core-ts` exports the per-isolate counters (`RequestMetrics`, `Histogram`). -- **Recipes.** The compose file gains an `otel` profile (an OpenTelemetry Collector with `otel-collector.yaml`), Caddy no longer serves `/api/metrics` publicly, and the Helm chart gains `otel.headersSecret` and `metrics.enabled`. diff --git a/.changeset/selfhost-smtp.md b/.changeset/selfhost-smtp.md deleted file mode 100644 index 0b00ed67..00000000 --- a/.changeset/selfhost-smtp.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@cloudhal/cli": minor ---- - -The self-host image mails invites and password resets (#291). Set `CLOUDHAL_SMTP_URL` (or `CLOUDHAL_SMTP_URL_FILE`) and `CLOUDHAL_MAIL_FROM`, and the generated workerd config gets an `smtp` Worker behind the admin Worker's `EMAIL` binding, the binding used on Cloudflare. -- It connects with STARTTLS (`smtp://`) or implicit TLS (`smtps://`) only. -- Retries are bounded. -- Its logs carry no message bodies and no credentials. -- `CLOUDHAL_SMTP_CA_FILE` adds certificates to trust. - -The compose file gains a `mail` profile (Mailpit), and the Helm chart gains `mail.*` values. diff --git a/.changeset/single-factor-warning.md b/.changeset/single-factor-warning.md deleted file mode 100644 index 8dece116..00000000 --- a/.changeset/single-factor-warning.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/cli": patch ---- - -`deploy --release --allow-single-factor` now prints a `WARNING` that names the risk: without the build-provenance attestation the install trusts the release key alone, so a stolen key could get a forged bundle deployed. The warning, the refusal message, `cloudhal --help` and the docs say not to use the flag in CI or scripts. Behaviour is unchanged (#234). diff --git a/.changeset/site-build-status-order.md b/.changeset/site-build-status-order.md deleted file mode 100644 index 6873e029..00000000 --- a/.changeset/site-build-status-order.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@cloudhal/api": patch -"@cloudhal/cli": patch ---- - -`GET /api/sites/:id/site-build` reads the rebuild queue's state before the last `site.build` row (#338). Read after, a build that ended during the request answered `idle` beside the previous build's row, so Studio could show the earlier build as the latest. `cloudhal studio`'s handle has `siteBuild.idle()` when `CLOUDHAL_SITE_BUILD` is on: it resolves once nothing is queued or running, with every finished build recorded. diff --git a/.changeset/sqlite-file-lock.md b/.changeset/sqlite-file-lock.md deleted file mode 100644 index 865200e5..00000000 --- a/.changeset/sqlite-file-lock.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@cloudhal/storage": patch -"@cloudhal/api": patch ---- - -`cloudhal studio` on Node no longer fails a sign-up (422 "Failed to create user: database is locked") when the store writes during it (#342). Better Auth and the store hold two connections to the project's `data.db`. A Better Auth transaction spans awaits (a sign-up reads, hashes the password, then writes), and a store write in between made its snapshot stale, or, once it had written, had to wait for SQLite's lock with the event loop blocked. Each SQLite file now has one in-process lock (`sqliteFileLock`, `@cloudhal/storage/sqlite`): Better Auth's transactions hold it from `BEGIN IMMEDIATE` to `COMMIT`, the store's driver takes it for each statement, and it is re-entrant inside a transaction. Both connections set a 5 s busy timeout for writers in other processes. Cloudflare and the workerd self-host image (D1) are not affected. diff --git a/.changeset/studio-guest-login.md b/.changeset/studio-guest-login.md deleted file mode 100644 index f70253ab..00000000 --- a/.changeset/studio-guest-login.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/cli": patch ---- - -Studio's `/login`, `/forgot-password` and `/reset-password` no longer show their forms to a signed-in member: they go on to `/sites`, or to the page the member was opening (#388). An MCP client's authorization request (`/login?client_id=…&sig=…`) still shows the sign-in form. A signed-out member who opens a deep link now returns to it after signing in, through `/login?redirect=`, which accepts only paths on Studio's own origin. In sign-in mode the email field is marked `autocomplete="username"`, so password managers offer the saved account. diff --git a/.changeset/studio-remembered-accounts.md b/.changeset/studio-remembered-accounts.md deleted file mode 100644 index 8267e3f5..00000000 --- a/.changeset/studio-remembered-accounts.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudhal/cli": patch ---- - -Studio's sign-in page can remember accounts on a device, like Cloudflare's login profiles (#388). "Remember this account on this device" is off by default; when ticked, a successful sign-in keeps the email, the display name and the time of the sign-in in the browser's `localStorage` (no password, token, session id or role), for at most five accounts per Studio address, each dropped after 30 days unused. The signed-out `/login` then lists them first: picking one fills in the email and focuses the password, ✕ forgets one, and "Use another account" shows the empty form. The account menu adds "Sign out and forget", which forgets the signed-in member's entry and signs out; plain "Sign out" keeps it. The new strings are AI drafts in every language but English, awaiting review. diff --git a/packages/agent-runtime/CHANGELOG.md b/packages/agent-runtime/CHANGELOG.md index 5cba139a..b00e9f94 100644 --- a/packages/agent-runtime/CHANGELOG.md +++ b/packages/agent-runtime/CHANGELOG.md @@ -1,5 +1,20 @@ # @cloudhal/agent-runtime +## 0.12.0 + +### Patch Changes + +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/storage@0.12.0 + - @cloudhal/core-contracts@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/agent-runtime/package.json b/packages/agent-runtime/package.json index f545e6e6..c6186613 100644 --- a/packages/agent-runtime/package.json +++ b/packages/agent-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/agent-runtime", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal agent runtime: policy engine (actors, scopes, approvals), skill loader, audit log", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 696a7037..de333f65 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,20 @@ # @cloudhal/analytics +## 0.12.0 + +### Patch Changes + +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/storage@0.12.0 + - @cloudhal/core-contracts@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 79325cde..15e7c37b 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/analytics", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal site analytics (RFC-0006): query model, classifiers, beacon handler, SQLite/D1 store, daily rollups and Workers Analytics Engine adapters. Worker-safe.", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index d9c9784d..f707e4bd 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -1,5 +1,100 @@ # @cloudhal/api +## 0.12.0 + +### Minor Changes + +- f215f7d: RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). + + - **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. + - **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. + - **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. + - **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. + - **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. +- e8a2146: RFC-0048 rollout step 3 adds the API side of agents' signed upload links. Links are not minted over MCP yet; `create_upload` and `complete_upload` come in step 4. + + - **The PUT route.** `PUT /api/sites/:siteId/assets/agent-uploads/:uploadId?sig=…` is the only route with the new `upload-link` requirement (RFC-0005 I15 as amended). The route guard reads no session for it, and `test/route-scopes.test.ts` pins it to that one route. The handler: + 1. checks the signature against the row; + 2. refuses a credential that belongs to another agent (`not_your_upload`) and ignores cookies; + 3. checks the headers before reading any byte: `Content-Encoding`, `Content-Type`, the exact `Content-Length`, and the type's cap; + 4. lets the store claim the row and stage the bytes. + + It answers §5.2's codes. Accepted PUTs are audited as `asset.upload-received`, without the link. Other methods answer 405 with `Allow: PUT`, and reveal nothing. + - **Signing.** Agent links are signed with a key derived under `cloudhal agent upload v1` (`signAgentUpload`, `verifyAgentUpload`, `agentUploadPath`). Studio's tickets keep `cloudhal upload ticket v1`, so neither kind of link verifies on the other's route. + - **`uploadSecret` (`CLOUDHAL_UPLOAD_SECRET` on the admin Worker, at least 32 characters).** It signs both kinds of upload link, ahead of the preview secret and the MCP state key, so it can rotate on its own. Requests can read whether the secret is configured or per process (`uploadSecretShared`), for step 4's capability flag. + - **The playground** refuses the new route (`uploads`). + +### Patch Changes + +- ae08828: Dependency updates: hono 4.13.23 (`@cloudhal/api`), temporal-polyfill 1.0.8 (`@cloudhal/core-ts`, `@cloudhal/schedules`), and in the starter that `cloudhal init` copies, Astro ^7.4.13 and Tailwind CSS ^4.3.5 (`tailwindcss` with `@tailwindcss/vite`). The Astro peer range of `@cloudhal/astro-renderer` and `@cloudhal/cli` stays `^7.4.0`. +- 3bde876: Studio previews show their images again when Studio and the site are on different hosts (#383). Preview HTML pointed blob images at the site's `/media/…` path, which only the site's host serves; Studio answered it with its own HTML. Previews now name a short-lived signed URL that Studio serves itself, `GET /api/sites/:siteId/preview-media/:assetId/.?v=…&exp=…&sig=…`: HMAC-SHA256 over the site, asset, SHA-256 prefix and expiry, with a key derived (HKDF) from `CLOUDHAL_PREVIEW_SECRET` or else `BETTER_AUTH_SECRET`. The signature is the credential, because the sandboxed preview sends no session cookie and has an opaque origin (the route answers `Cross-Origin-Resource-Policy: cross-origin`). Expiries are bucketed to 6 hours, so re-renders keep the same URL and the browser cache hits. Covers, section images, `asset:` references, Markdown `/media/…` images and drafts' never-published uploads are all rewritten; external images keep their URL. A taken-down file answers 410. The playground routes these URLs to their session without the cookie. +- 1f2efea: RFC-0045 rollout step 8a: listings by reference (see the RFC's "Amended in 8a"). + + - **A reference field can be a listing field.** Its conditions are `eq`, `ne`, `in`, `set` and `unset` on translation group ids, with a multiple select's meaning for a multiple reference (contains, contains any). There is no ordering and no `all`. The values come from `resolveFields`, so a translation filters by its original's non-localized reference. + - **Member ids read as their group's** in every query path: the store's `queryContentEntries` (API `GET …/entries?where=`, MCP `list_entries`), `contentList` sections (stored as group ids on page writes) and the renderer's `queryEntries`/`contentList`. + - **Rebuild:** `entry_list_values` rows hold reference group ids now, and the list fingerprint's format is 3, so every listed collection is rebuilt once by `lists.backfill` (Cloudflare) or at start-up (`rebuildListValues`, Node). Until then listings answer from the in-memory evaluator. + - **Studio:** a content list condition on a reference picks its entries with the entry picker. A collection list shows a reference column as titles and filters it by a chosen entry. The "Listing fields" warning now names repeaters only. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so reference listing fields and conditions on them stay refused (`reference_listings_unsupported`) until the release that enables step 8. +- 0fb2f95: RFC-0045 rollout step 8b: structured data from references (see the RFC's "Amended in 8b"). + + - **Contract:** a fifth structured-data source, `ReferenceValueSource` (`{ "kind": "reference", "field": "venue", "property": "title" }` or `"targetField": "city"`), and the `ReferenceValueProperty` enum (`title`, `url`, `summary`). + - **Event.location from a venue entry:** a preset can read the entry a single, one-target reference field names. That is the member the page shows (its language, the site's fallback, published and not gated), with a translation's non-localized fields read from its original. Without one, its properties are left out, and a missing required one keeps the `BlogPosting`. + - **Checks:** `structured_data_invalid` when the source names a field that is not such a reference, gives both or neither of `property`/`targetField`, or reads a card property or target field the path does not take. Field operations on the target's field see the presets that read it (rename follows, remove and an unfitting retype are refused). + - **Previews:** MCP `preview_structured_data` and Studio's preview read the working copy's published referenced entries. + - **Studio:** the structured-data card offers "From Venue: Title", "From Venue: City" and the like. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so a write that adds a reference source is refused (`reference_listings_unsupported`) until the release that enables step 8. +- c0e8651: RFC-0048 rollout step 2 adds the store side of agents' signed upload links. There are no agent tools or REST route yet; those come in steps 3 and 4. + + - **Migration `0035_agent_uploads`.** This additive migration adds `purpose`, `attempts`, `complete_by`, `received` and `asset_id` to `media_uploads`, plus an index on `(site_id, state)`. Studio's tickets become `purpose = 'studio'` rows and behave as before. Studio's ticket queries now read only those rows. + - **`store.uploads` (`AgentUploads`).** + - `open` creates a row bound to one file: size, type and a required SHA-256. It is created only while the key (10) and the site (50) are under their open limits and the site quota can hold the declared bytes beside the uploads in progress. + - `receive` is the link's PUT. It claims the row with a CAS before reading any byte and stages exactly the declared bytes. Images are buffered and stripped; other files are streamed. A refused PUT reopens the row, up to three attempts. + - `complete` inserts the asset node in one guarded `batch()`. The batch requires the row to be `received` before `completeBy` and the blob to be stored, and anchors the row's `completed` state and the lease release on the new node's hash. Repeating the call returns the same asset. + - `stats` returns the pending uploads, for the daily limit. + - **Staging is split out.** `ingestAsset` and `ingestAssetStream` now run staging (`media/stage.ts`: lease, put, verify, `stored`) and then completion (node and lease release). The agent link runs the two steps separately and holds the lease until `completeBy`. Unfinished uploads are then collected by the existing media garbage collection. + - **Blob leases are never shortened.** `leaseBlob` keeps the longer of the old and new lease. + - **New invariant codes**, with their HTTP statuses: `checksum_mismatch` and `size_mismatch` (400); `upload_used`, `upload_expired` and `too_many_attempts` (410); `too_many_uploads` and `upload_pending` (409). +- 311da20: RFC-0048 rollout step 4: agents can now upload large files from disk without base64. + + - **`create_upload`** (scope `asset:upload`, gated like `upload_asset`) takes a file's exact size, type and SHA-256 and returns a 10-minute PUT link with a ready `curl` line. When the library already holds those bytes, it answers `status: "existing"` with the asset instead. + - **`complete_upload`** turns the received bytes into the asset and answers as `upload_asset` does. It asks for no second approval: it is refused in `plan` and free in `manual`. Calling it again returns the same asset. + - **Schemas.** Optional inputs accept `null`. The output follows the strict profile: every key is always present, `null` where it does not apply. + - **`get_mode.uploads`** reports `{signedUrl, maxBytes, linkSeconds}`. Links are off on stdio `cloudhal mcp`, without a shared signing secret, or with `media.agentUploads: false`. The per-file cap is `media.agentUploadBytes`: 25 MB by default, at most 100 MB. The server instructions mention `create_upload` only where links are on. + - **Refusals** (`upload-hints.ts`) use existing tool codes with a `details.reason`: `upload_cap`, `unsupported_type`, `checksum_required`, `too_many_uploads` (10 open per key, 50 per site), `quota_exceeded`, `signed_upload_unsupported`, `upload_pending`, `upload_failed`, `too_many_attempts`, `upload_not_found` and `upload_expired`. Each comes with the agent's next step. + - **The daily limit** (100 files, 500 MB) now counts open uploads with their declared bytes. + - **Audit rows** name the upload and never hold the link. + - **The README tool table** is regenerated. + - **The API** passes `/mcp` the link signer, whether the secret is shared, and the configured origin. Links point at the configured origin, else at the `/mcp` request's. +- 88ebb41: `GET /api/sites/:id/site-build` reads the rebuild queue's state before the last `site.build` row (#338). Read after, a build that ended during the request answered `idle` beside the previous build's row, so Studio could show the earlier build as the latest. `cloudhal studio`'s handle has `siteBuild.idle()` when `CLOUDHAL_SITE_BUILD` is on: it resolves once nothing is queued or running, with every finished build recorded. +- b16a16e: `cloudhal studio` on Node no longer fails a sign-up (422 "Failed to create user: database is locked") when the store writes during it (#342). Better Auth and the store hold two connections to the project's `data.db`. A Better Auth transaction spans awaits (a sign-up reads, hashes the password, then writes), and a store write in between made its snapshot stale, or, once it had written, had to wait for SQLite's lock with the event loop blocked. Each SQLite file now has one in-process lock (`sqliteFileLock`, `@cloudhal/storage/sqlite`): Better Auth's transactions hold it from `BEGIN IMMEDIATE` to `COMMIT`, the store's driver takes it for each statement, and it is re-entrant inside a transaction. Both connections set a 5 s busy timeout for writers in other processes. Cloudflare and the workerd self-host image (D1) are not affected. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [1cde17d] +- Updated dependencies [ec7ea96] +- Updated dependencies [40f7494] +- Updated dependencies [3bde876] +- Updated dependencies [f215f7d] +- Updated dependencies [1f2efea] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [311da20] +- Updated dependencies [fd496b4] +- Updated dependencies [0842229] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/core-ts@0.12.0 + - @cloudhal/storage@0.12.0 + - @cloudhal/schedules@0.12.0 + - @cloudhal/astro-renderer@0.12.0 + - @cloudhal/mcp-server@0.12.0 + - @cloudhal/core-contracts@0.12.0 + - @cloudhal/comments@0.12.0 + - @cloudhal/agent-runtime@0.12.0 + - @cloudhal/analytics@0.12.0 + ## 0.11.0 ### Minor Changes diff --git a/packages/api/package.json b/packages/api/package.json index ac6cb604..5fbded80 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/api", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal HTTP API (Hono): sites, pages, entries, snapshots, auth — runs on Node and Cloudflare Workers", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/astro-renderer/CHANGELOG.md b/packages/astro-renderer/CHANGELOG.md index 2fa001e6..2e277fc3 100644 --- a/packages/astro-renderer/CHANGELOG.md +++ b/packages/astro-renderer/CHANGELOG.md @@ -1,5 +1,78 @@ # @cloudhal/astro-renderer +## 0.12.0 + +### Minor Changes + +- f215f7d: RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). + + - **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. + - **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. + - **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. + - **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. + - **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. +- 1f2efea: RFC-0045 rollout step 8a: listings by reference (see the RFC's "Amended in 8a"). + + - **A reference field can be a listing field.** Its conditions are `eq`, `ne`, `in`, `set` and `unset` on translation group ids, with a multiple select's meaning for a multiple reference (contains, contains any). There is no ordering and no `all`. The values come from `resolveFields`, so a translation filters by its original's non-localized reference. + - **Member ids read as their group's** in every query path: the store's `queryContentEntries` (API `GET …/entries?where=`, MCP `list_entries`), `contentList` sections (stored as group ids on page writes) and the renderer's `queryEntries`/`contentList`. + - **Rebuild:** `entry_list_values` rows hold reference group ids now, and the list fingerprint's format is 3, so every listed collection is rebuilt once by `lists.backfill` (Cloudflare) or at start-up (`rebuildListValues`, Node). Until then listings answer from the in-memory evaluator. + - **Studio:** a content list condition on a reference picks its entries with the entry picker. A collection list shows a reference column as titles and filters it by a chosen entry. The "Listing fields" warning now names repeaters only. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so reference listing fields and conditions on them stay refused (`reference_listings_unsupported`) until the release that enables step 8. +- 0fb2f95: RFC-0045 rollout step 8b: structured data from references (see the RFC's "Amended in 8b"). + + - **Contract:** a fifth structured-data source, `ReferenceValueSource` (`{ "kind": "reference", "field": "venue", "property": "title" }` or `"targetField": "city"`), and the `ReferenceValueProperty` enum (`title`, `url`, `summary`). + - **Event.location from a venue entry:** a preset can read the entry a single, one-target reference field names. That is the member the page shows (its language, the site's fallback, published and not gated), with a translation's non-localized fields read from its original. Without one, its properties are left out, and a missing required one keeps the `BlogPosting`. + - **Checks:** `structured_data_invalid` when the source names a field that is not such a reference, gives both or neither of `property`/`targetField`, or reads a card property or target field the path does not take. Field operations on the target's field see the presets that read it (rename follows, remove and an unfitting retype are refused). + - **Previews:** MCP `preview_structured_data` and Studio's preview read the working copy's published referenced entries. + - **Studio:** the structured-data card offers "From Venue: Title", "From Venue: City" and the like. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so a write that adds a reference source is refused (`reference_listings_unsupported`) until the release that enables step 8. +- e8eabce: RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). + + - **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. + - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. + - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. + - No venue means no match, `ne` and `unset` included. + - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. + - **Contract:** `FieldCondition.field` accepts one dot. + - **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. + - **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: + - reference listing fields and `contentList` conditions on them (8a); + - `ReferenceValueSource` presets (8b); + - one-hop conditions. + + A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. + - **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. +- 42ee52a: Observability for self-host (#293; RFC-0047 §7a). + - **Traces.** `OTEL_EXPORTER_OTLP_ENDPOINT` takes `https://` too, and `OTEL_EXPORTER_OTLP_HEADERS` adds a backend's headers. Every export carries `x-cloudhal-instance` and `x-cloudhal-version` headers for the collector to turn into resource attributes. + - **Metrics.** The admin Worker gains `GET /api/metrics` (Prometheus text). It is off unless `CLOUDHAL_METRICS_TOKEN` is set, and then answers only that bearer token. It covers requests of the admin and site Workers (the site's through `/__cloudhal/metrics`), publish durations, scheduler lag and health, and store errors. + - **Supporting changes.** `D1Driver` takes an `onError` hook, and `@cloudhal/core-ts` exports the per-isolate counters (`RequestMetrics`, `Histogram`). + - **Recipes.** The compose file gains an `otel` profile (an OpenTelemetry Collector with `otel-collector.yaml`), Caddy no longer serves `/api/metrics` publicly, and the Helm chart gains `otel.headersSecret` and `metrics.enabled`. + +### Patch Changes + +- 1cde17d: Spanish status pages read the way a native speaker decided (#355): impersonal phrasing instead of tú, and "Disponible de nuevo: {time}" for the return time. Studio's Spanish uses the same reviewer's wording for the consent screen, connected agents, collections and listings. +- ec7ea96: Swedish (`sv`, Svenska): Studio and the site status pages in Swedish, an AI translation awaiting review on Weblate. Studio's language menu lists it under "Machine translated". +- 3bde876: Studio previews show their images again when Studio and the site are on different hosts (#383). Preview HTML pointed blob images at the site's `/media/…` path, which only the site's host serves; Studio answered it with its own HTML. Previews now name a short-lived signed URL that Studio serves itself, `GET /api/sites/:siteId/preview-media/:assetId/.?v=…&exp=…&sig=…`: HMAC-SHA256 over the site, asset, SHA-256 prefix and expiry, with a key derived (HKDF) from `CLOUDHAL_PREVIEW_SECRET` or else `BETTER_AUTH_SECRET`. The signature is the credential, because the sandboxed preview sends no session cookie and has an opaque origin (the route answers `Cross-Origin-Resource-Policy: cross-origin`). Expiries are bucketed to 6 hours, so re-renders keep the same URL and the browser cache hits. Covers, section images, `asset:` references, Markdown `/media/…` images and drafts' never-published uploads are all rewritten; external images keep their URL. A taken-down file answers 410. The playground routes these URLs to their session without the cookie. +- 0842229: Scroll stories on phones (#288): where the theme stacks a `Scrolly`'s sticky panel above the steps, the current step is now the one the reader sees below the panel, not the one passing beneath it. The motion module (now `/_cloudhal/motion.5.js`, with `motion.4.js` as an alias) measures the panel and puts the line in the middle of the screen below it; beside the steps (wide screens) the band is unchanged. It also writes the panel's tallest height to `--ch-scrolly-panel-h`, which the blog starter uses as the stacked panel's `min-height`, so a shorter card no longer pulls the steps up. Themes created before this get the new line on upgrade without a CSS change; copying the one-line `min-height` rule from the starter's `motion-scroll.css` adds the steadier panel. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [3bde876] +- Updated dependencies [f215f7d] +- Updated dependencies [1f2efea] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/core-ts@0.12.0 + - @cloudhal/storage@0.12.0 + - @cloudhal/core-contracts@0.12.0 + - @cloudhal/comments@0.12.0 + - @cloudhal/analytics@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/astro-renderer/package.json b/packages/astro-renderer/package.json index 44a6b705..2fd29f6e 100644 --- a/packages/astro-renderer/package.json +++ b/packages/astro-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/astro-renderer", - "version": "0.11.0", + "version": "0.12.0", "description": "Render a Cloudhal Site Graph with Astro: data sources (live/snapshot), section components and the cloudhal() integration", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index a0cfcd6d..87167d04 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,107 @@ # @cloudhal/cli +## 0.12.0 + +### Minor Changes + +- fd496b4: RFC-0048 rollout step 5 finishes agents' signed upload links on every host. + + - **Compatibility (`@cloudhal/release-verify`, `@cloudhal/core-contracts`):** verifiers before 0.12 refuse 0.12+ manifests; update the verifier with the CLI. The release manifest's `SecretName` gains `CLOUDHAL_UPLOAD_SECRET`, which 0.12+ manifests list for the admin Worker, and an older verifier rejects the unknown value. The new schema still verifies older bundles. Portable copies of the schema need the new `release-manifest` fingerprint (RFC-0046, amended). + - **`CLOUDHAL_UPLOAD_SECRET`:** + - `cloudhal deploy` generates it once into `.cloudhal/deploy/secrets.json` (0600) and gives it to the admin Worker. It signs upload tickets and agents' upload links ahead of the preview secret, so it can rotate on its own. + - The release manifest's `SecretName` gains it, an additive contract change. + - On self-host it is optional, with `_FILE` supported. `cloudhal selfhost secrets` generates it for new installations; when unset, the preview secret signs; a value shorter than 32 characters stops the image at start. The compose file passes it through. + - **`cloudhal.json` `media.agentUploads: false`** turns the links off, and **`media.agentUploadBytes`** caps a file (25 MB by default, at most 100 MB). + - They become the admin Worker's vars `CLOUDHAL_AGENT_UPLOADS` and `CLOUDHAL_AGENT_UPLOAD_BYTES`. Self-host takes the same vars from its environment, and `cloudhal studio` reads them from the project. + - The release key table classes both as `deploy` keys, so `deploy --release` accepts any value. + - **Studio's Activity** labels `create_upload`, `complete_upload` and `asset.upload-received` in every language. Languages other than English are drafts awaiting review. + - **A guide**, `docs/guides/agent-uploads.md`, covers the flow, the settings, the secret and its rotation, keeping `?sig=` out of proxy access logs and `wrangler tail`, and body size limits. The self-host guide and the threat model now list the new settings and the mitigations. +- 4e175b1: `render_page` on self-host through an optional Chrome sidecar (#292). + - **The setting.** `CLOUDHAL_BROWSER_URL` (Chrome's DevTools port) gives the admin Worker a `BROWSER_CDP` binding. + - **The driver.** `@cloudhal/cloudflare`'s new `devtoolsRenderer` drives it with the shared `cdpSession`: one browser context per render, and the shared browser is never closed. + - **What it opens.** `render_page` opens only the page's signed preview link. With `RenderDeps.origin` (`CLOUDHAL_RENDER_ORIGIN`, default `http://cloudhal:8788`) it opens the link at that private origin, so a site without a domain renders too. `@cloudhal/core-ts` gains `previewUrlAt`. + - **The recipes.** The compose file gains a `chrome` profile: no port, and a network shared with Cloudhal only. The Helm chart gains `chrome.*` values: a Deployment, a Service and a NetworkPolicy. +- 42ee52a: Observability for self-host (#293; RFC-0047 §7a). + - **Traces.** `OTEL_EXPORTER_OTLP_ENDPOINT` takes `https://` too, and `OTEL_EXPORTER_OTLP_HEADERS` adds a backend's headers. Every export carries `x-cloudhal-instance` and `x-cloudhal-version` headers for the collector to turn into resource attributes. + - **Metrics.** The admin Worker gains `GET /api/metrics` (Prometheus text). It is off unless `CLOUDHAL_METRICS_TOKEN` is set, and then answers only that bearer token. It covers requests of the admin and site Workers (the site's through `/__cloudhal/metrics`), publish durations, scheduler lag and health, and store errors. + - **Supporting changes.** `D1Driver` takes an `onError` hook, and `@cloudhal/core-ts` exports the per-isolate counters (`RequestMetrics`, `Histogram`). + - **Recipes.** The compose file gains an `otel` profile (an OpenTelemetry Collector with `otel-collector.yaml`), Caddy no longer serves `/api/metrics` publicly, and the Helm chart gains `otel.headersSecret` and `metrics.enabled`. +- be8f768: The self-host image mails invites and password resets (#291). Set `CLOUDHAL_SMTP_URL` (or `CLOUDHAL_SMTP_URL_FILE`) and `CLOUDHAL_MAIL_FROM`, and the generated workerd config gets an `smtp` Worker behind the admin Worker's `EMAIL` binding, the binding used on Cloudflare. + - It connects with STARTTLS (`smtp://`) or implicit TLS (`smtps://`) only. + - Retries are bounded. + - Its logs carry no message bodies and no credentials. + - `CLOUDHAL_SMTP_CA_FILE` adds certificates to trust. + + The compose file gains a `mail` profile (Mailpit), and the Helm chart gains `mail.*` values. + +### Patch Changes + +- ae08828: Dependency updates: hono 4.13.23 (`@cloudhal/api`), temporal-polyfill 1.0.8 (`@cloudhal/core-ts`, `@cloudhal/schedules`), and in the starter that `cloudhal init` copies, Astro ^7.4.13 and Tailwind CSS ^4.3.5 (`tailwindcss` with `@tailwindcss/vite`). The Astro peer range of `@cloudhal/astro-renderer` and `@cloudhal/cli` stays `^7.4.0`. +- 1cde17d: Spanish status pages read the way a native speaker decided (#355): impersonal phrasing instead of tú, and "Disponible de nuevo: {time}" for the return time. Studio's Spanish uses the same reviewer's wording for the consent screen, connected agents, collections and listings. +- 1c187a4: Studio's Turkish and French keep every argument English shows: Turkish permission notices name the roles that may act ("Yalnızca Editörler ve üstü …"), the delete dialog names what it deletes, and the menu delete dialog names the menu; French taxonomy empty states use the taxonomy's plural name. Translations from Weblate are now checked the same way before they reach Studio. +- b456c34: Studio's language menus now say which languages are machine translations: they are listed under "Machine translated", and while Studio speaks one, a "Machine translated · help review" link beside the menu leads to the translation project (#112, ADR-0034 amendment). +- ec7ea96: Swedish (`sv`, Svenska): Studio and the site status pages in Swedish, an AI translation awaiting review on Weblate. Studio's language menu lists it under "Machine translated". +- f215f7d: RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). + + - **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. + - **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. + - **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. + - **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. + - **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. +- e8eabce: RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). + + - **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. + - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. + - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. + - No venue means no match, `ne` and `unset` included. + - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. + - **Contract:** `FieldCondition.field` accepts one dot. + - **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. + - **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: + - reference listing fields and `contentList` conditions on them (8a); + - `ReferenceValueSource` presets (8b); + - one-hop conditions. + + A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. + - **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. +- 0842229: Scroll stories on phones (#288): where the theme stacks a `Scrolly`'s sticky panel above the steps, the current step is now the one the reader sees below the panel, not the one passing beneath it. The motion module (now `/_cloudhal/motion.5.js`, with `motion.4.js` as an alias) measures the panel and puts the line in the middle of the screen below it; beside the steps (wide screens) the band is unchanged. It also writes the panel's tallest height to `--ch-scrolly-panel-h`, which the blog starter uses as the stacked panel's `min-height`, so a shorter card no longer pulls the steps up. Themes created before this get the new line on upgrade without a CSS change; copying the one-line `min-height` rule from the starter's `motion-scroll.css` adds the steadier panel. +- daf3dad: `deploy --release --allow-single-factor` now prints a `WARNING` that names the risk: without the build-provenance attestation the install trusts the release key alone, so a stolen key could get a forged bundle deployed. The warning, the refusal message, `cloudhal --help` and the docs say not to use the flag in CI or scripts. Behaviour is unchanged (#234). +- 88ebb41: `GET /api/sites/:id/site-build` reads the rebuild queue's state before the last `site.build` row (#338). Read after, a build that ended during the request answered `idle` beside the previous build's row, so Studio could show the earlier build as the latest. `cloudhal studio`'s handle has `siteBuild.idle()` when `CLOUDHAL_SITE_BUILD` is on: it resolves once nothing is queued or running, with every finished build recorded. +- d53e5c0: Studio's `/login`, `/forgot-password` and `/reset-password` no longer show their forms to a signed-in member: they go on to `/sites`, or to the page the member was opening (#388). An MCP client's authorization request (`/login?client_id=…&sig=…`) still shows the sign-in form. A signed-out member who opens a deep link now returns to it after signing in, through `/login?redirect=`, which accepts only paths on Studio's own origin. In sign-in mode the email field is marked `autocomplete="username"`, so password managers offer the saved account. +- 43e6199: Studio's sign-in page can remember accounts on a device, like Cloudflare's login profiles (#388). "Remember this account on this device" is off by default; when ticked, a successful sign-in keeps the email, the display name and the time of the sign-in in the browser's `localStorage` (no password, token, session id or role), for at most five accounts per Studio address, each dropped after 30 days unused. The signed-out `/login` then lists them first: picking one fills in the email and focuses the password, ✕ forgets one, and "Use another account" shows the empty form. The account menu adds "Sign out and forget", which forgets the signed-in member's entry and signs out; plain "Sign out" keeps it. The new strings are AI drafts in every language but English, awaiting review. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [1cde17d] +- Updated dependencies [ec7ea96] +- Updated dependencies [40f7494] +- Updated dependencies [3bde876] +- Updated dependencies [f215f7d] +- Updated dependencies [1f2efea] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [e8a2146] +- Updated dependencies [311da20] +- Updated dependencies [fd496b4] +- Updated dependencies [0842229] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [88ebb41] +- Updated dependencies [b16a16e] + - @cloudhal/core-ts@0.12.0 + - @cloudhal/storage@0.12.0 + - @cloudhal/api@0.12.0 + - @cloudhal/schedules@0.12.0 + - @cloudhal/astro-renderer@0.12.0 + - @cloudhal/mcp-server@0.12.0 + - @cloudhal/cloudflare@0.12.0 + - @cloudhal/core-contracts@0.12.0 + - @cloudhal/release-verify@0.12.0 + - @cloudhal/comments@0.12.0 + - @cloudhal/agent-runtime@0.12.0 + - @cloudhal/analytics@0.12.0 + ## 0.11.0 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index baf552f7..0375b004 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/cli", - "version": "0.11.0", + "version": "0.12.0", "description": "cloudhal \u2014 create, run and build Cloudhal sites locally", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/cloudflare/CHANGELOG.md b/packages/cloudflare/CHANGELOG.md index a79e5333..a707e50c 100644 --- a/packages/cloudflare/CHANGELOG.md +++ b/packages/cloudflare/CHANGELOG.md @@ -1,5 +1,95 @@ # @cloudhal/cloudflare +## 0.12.0 + +### Minor Changes + +- f215f7d: RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). + + - **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. + - **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. + - **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. + - **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. + - **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. +- e8eabce: RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). + + - **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. + - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. + - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. + - No venue means no match, `ne` and `unset` included. + - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. + - **Contract:** `FieldCondition.field` accepts one dot. + - **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. + - **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: + - reference listing fields and `contentList` conditions on them (8a); + - `ReferenceValueSource` presets (8b); + - one-hop conditions. + + A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. + - **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. +- 4e175b1: `render_page` on self-host through an optional Chrome sidecar (#292). + - **The setting.** `CLOUDHAL_BROWSER_URL` (Chrome's DevTools port) gives the admin Worker a `BROWSER_CDP` binding. + - **The driver.** `@cloudhal/cloudflare`'s new `devtoolsRenderer` drives it with the shared `cdpSession`: one browser context per render, and the shared browser is never closed. + - **What it opens.** `render_page` opens only the page's signed preview link. With `RenderDeps.origin` (`CLOUDHAL_RENDER_ORIGIN`, default `http://cloudhal:8788`) it opens the link at that private origin, so a site without a domain renders too. `@cloudhal/core-ts` gains `previewUrlAt`. + - **The recipes.** The compose file gains a `chrome` profile: no port, and a network shared with Cloudhal only. The Helm chart gains `chrome.*` values: a Deployment, a Service and a NetworkPolicy. +- 42ee52a: Observability for self-host (#293; RFC-0047 §7a). + - **Traces.** `OTEL_EXPORTER_OTLP_ENDPOINT` takes `https://` too, and `OTEL_EXPORTER_OTLP_HEADERS` adds a backend's headers. Every export carries `x-cloudhal-instance` and `x-cloudhal-version` headers for the collector to turn into resource attributes. + - **Metrics.** The admin Worker gains `GET /api/metrics` (Prometheus text). It is off unless `CLOUDHAL_METRICS_TOKEN` is set, and then answers only that bearer token. It covers requests of the admin and site Workers (the site's through `/__cloudhal/metrics`), publish durations, scheduler lag and health, and store errors. + - **Supporting changes.** `D1Driver` takes an `onError` hook, and `@cloudhal/core-ts` exports the per-isolate counters (`RequestMetrics`, `Histogram`). + - **Recipes.** The compose file gains an `otel` profile (an OpenTelemetry Collector with `otel-collector.yaml`), Caddy no longer serves `/api/metrics` publicly, and the Helm chart gains `otel.headersSecret` and `metrics.enabled`. + +### Patch Changes + +- 3bde876: Studio previews show their images again when Studio and the site are on different hosts (#383). Preview HTML pointed blob images at the site's `/media/…` path, which only the site's host serves; Studio answered it with its own HTML. Previews now name a short-lived signed URL that Studio serves itself, `GET /api/sites/:siteId/preview-media/:assetId/.?v=…&exp=…&sig=…`: HMAC-SHA256 over the site, asset, SHA-256 prefix and expiry, with a key derived (HKDF) from `CLOUDHAL_PREVIEW_SECRET` or else `BETTER_AUTH_SECRET`. The signature is the credential, because the sandboxed preview sends no session cookie and has an opaque origin (the route answers `Cross-Origin-Resource-Policy: cross-origin`). Expiries are bucketed to 6 hours, so re-renders keep the same URL and the browser cache hits. Covers, section images, `asset:` references, Markdown `/media/…` images and drafts' never-published uploads are all rewritten; external images keep their URL. A taken-down file answers 410. The playground routes these URLs to their session without the cookie. +- e8a2146: RFC-0048 rollout step 3 adds the API side of agents' signed upload links. Links are not minted over MCP yet; `create_upload` and `complete_upload` come in step 4. + + - **The PUT route.** `PUT /api/sites/:siteId/assets/agent-uploads/:uploadId?sig=…` is the only route with the new `upload-link` requirement (RFC-0005 I15 as amended). The route guard reads no session for it, and `test/route-scopes.test.ts` pins it to that one route. The handler: + 1. checks the signature against the row; + 2. refuses a credential that belongs to another agent (`not_your_upload`) and ignores cookies; + 3. checks the headers before reading any byte: `Content-Encoding`, `Content-Type`, the exact `Content-Length`, and the type's cap; + 4. lets the store claim the row and stage the bytes. + + It answers §5.2's codes. Accepted PUTs are audited as `asset.upload-received`, without the link. Other methods answer 405 with `Allow: PUT`, and reveal nothing. + - **Signing.** Agent links are signed with a key derived under `cloudhal agent upload v1` (`signAgentUpload`, `verifyAgentUpload`, `agentUploadPath`). Studio's tickets keep `cloudhal upload ticket v1`, so neither kind of link verifies on the other's route. + - **`uploadSecret` (`CLOUDHAL_UPLOAD_SECRET` on the admin Worker, at least 32 characters).** It signs both kinds of upload link, ahead of the preview secret and the MCP state key, so it can rotate on its own. Requests can read whether the secret is configured or per process (`uploadSecretShared`), for step 4's capability flag. + - **The playground** refuses the new route (`uploads`). +- fd496b4: RFC-0048 rollout step 5 finishes agents' signed upload links on every host. + + - **Compatibility (`@cloudhal/release-verify`, `@cloudhal/core-contracts`):** verifiers before 0.12 refuse 0.12+ manifests; update the verifier with the CLI. The release manifest's `SecretName` gains `CLOUDHAL_UPLOAD_SECRET`, which 0.12+ manifests list for the admin Worker, and an older verifier rejects the unknown value. The new schema still verifies older bundles. Portable copies of the schema need the new `release-manifest` fingerprint (RFC-0046, amended). + - **`CLOUDHAL_UPLOAD_SECRET`:** + - `cloudhal deploy` generates it once into `.cloudhal/deploy/secrets.json` (0600) and gives it to the admin Worker. It signs upload tickets and agents' upload links ahead of the preview secret, so it can rotate on its own. + - The release manifest's `SecretName` gains it, an additive contract change. + - On self-host it is optional, with `_FILE` supported. `cloudhal selfhost secrets` generates it for new installations; when unset, the preview secret signs; a value shorter than 32 characters stops the image at start. The compose file passes it through. + - **`cloudhal.json` `media.agentUploads: false`** turns the links off, and **`media.agentUploadBytes`** caps a file (25 MB by default, at most 100 MB). + - They become the admin Worker's vars `CLOUDHAL_AGENT_UPLOADS` and `CLOUDHAL_AGENT_UPLOAD_BYTES`. Self-host takes the same vars from its environment, and `cloudhal studio` reads them from the project. + - The release key table classes both as `deploy` keys, so `deploy --release` accepts any value. + - **Studio's Activity** labels `create_upload`, `complete_upload` and `asset.upload-received` in every language. Languages other than English are drafts awaiting review. + - **A guide**, `docs/guides/agent-uploads.md`, covers the flow, the settings, the secret and its rotation, keeping `?sig=` out of proxy access logs and `wrangler tail`, and body size limits. The self-host guide and the threat model now list the new settings and the mitigations. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [40f7494] +- Updated dependencies [3bde876] +- Updated dependencies [f215f7d] +- Updated dependencies [1f2efea] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [e8a2146] +- Updated dependencies [311da20] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [88ebb41] +- Updated dependencies [b16a16e] + - @cloudhal/core-ts@0.12.0 + - @cloudhal/storage@0.12.0 + - @cloudhal/api@0.12.0 + - @cloudhal/schedules@0.12.0 + - @cloudhal/mcp-server@0.12.0 + - @cloudhal/comments@0.12.0 + - @cloudhal/agent-runtime@0.12.0 + - @cloudhal/analytics@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/cloudflare/package.json b/packages/cloudflare/package.json index 3cc36d62..38dccb05 100644 --- a/packages/cloudflare/package.json +++ b/packages/cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/cloudflare", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal on Cloudflare: the admin Worker (API, auth, MCP, Studio) over D1 + R2", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/comments/CHANGELOG.md b/packages/comments/CHANGELOG.md index 0ae41123..49d5d19f 100644 --- a/packages/comments/CHANGELOG.md +++ b/packages/comments/CHANGELOG.md @@ -1,5 +1,26 @@ # @cloudhal/comments +## 0.12.0 + +### Patch Changes + +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [3bde876] +- Updated dependencies [f215f7d] +- Updated dependencies [1f2efea] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/core-ts@0.12.0 + - @cloudhal/storage@0.12.0 + - @cloudhal/core-contracts@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/comments/package.json b/packages/comments/package.json index 8e839931..449e3898 100644 --- a/packages/comments/package.json +++ b/packages/comments/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/comments", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal reader comments (RFC-0007): settings and thread state, text normalising and content rules, linkify, first-party proof of work, the submission pipeline, purge planner, retention plan and the SQLite/D1 store. Worker-safe.", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/core-contracts/CHANGELOG.md b/packages/core-contracts/CHANGELOG.md index 150c47cb..26c8ad63 100644 --- a/packages/core-contracts/CHANGELOG.md +++ b/packages/core-contracts/CHANGELOG.md @@ -1,5 +1,46 @@ # @cloudhal/core-contracts +## 0.12.0 + +### Minor Changes + +- 0fb2f95: RFC-0045 rollout step 8b: structured data from references (see the RFC's "Amended in 8b"). + + - **Contract:** a fifth structured-data source, `ReferenceValueSource` (`{ "kind": "reference", "field": "venue", "property": "title" }` or `"targetField": "city"`), and the `ReferenceValueProperty` enum (`title`, `url`, `summary`). + - **Event.location from a venue entry:** a preset can read the entry a single, one-target reference field names. That is the member the page shows (its language, the site's fallback, published and not gated), with a translation's non-localized fields read from its original. Without one, its properties are left out, and a missing required one keeps the `BlogPosting`. + - **Checks:** `structured_data_invalid` when the source names a field that is not such a reference, gives both or neither of `property`/`targetField`, or reads a card property or target field the path does not take. Field operations on the target's field see the presets that read it (rename follows, remove and an unfitting retype are refused). + - **Previews:** MCP `preview_structured_data` and Studio's preview read the working copy's published referenced entries. + - **Studio:** the structured-data card offers "From Venue: Title", "From Venue: City" and the like. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so a write that adds a reference source is refused (`reference_listings_unsupported`) until the release that enables step 8. +- e8eabce: RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). + + - **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. + - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. + - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. + - No venue means no match, `ne` and `unset` included. + - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. + - **Contract:** `FieldCondition.field` accepts one dot. + - **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. + - **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: + - reference listing fields and `contentList` conditions on them (8a); + - `ReferenceValueSource` presets (8b); + - one-hop conditions. + + A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. + - **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. +- fd496b4: RFC-0048 rollout step 5 finishes agents' signed upload links on every host. + + - **Compatibility (`@cloudhal/release-verify`, `@cloudhal/core-contracts`):** verifiers before 0.12 refuse 0.12+ manifests; update the verifier with the CLI. The release manifest's `SecretName` gains `CLOUDHAL_UPLOAD_SECRET`, which 0.12+ manifests list for the admin Worker, and an older verifier rejects the unknown value. The new schema still verifies older bundles. Portable copies of the schema need the new `release-manifest` fingerprint (RFC-0046, amended). + - **`CLOUDHAL_UPLOAD_SECRET`:** + - `cloudhal deploy` generates it once into `.cloudhal/deploy/secrets.json` (0600) and gives it to the admin Worker. It signs upload tickets and agents' upload links ahead of the preview secret, so it can rotate on its own. + - The release manifest's `SecretName` gains it, an additive contract change. + - On self-host it is optional, with `_FILE` supported. `cloudhal selfhost secrets` generates it for new installations; when unset, the preview secret signs; a value shorter than 32 characters stops the image at start. The compose file passes it through. + - **`cloudhal.json` `media.agentUploads: false`** turns the links off, and **`media.agentUploadBytes`** caps a file (25 MB by default, at most 100 MB). + - They become the admin Worker's vars `CLOUDHAL_AGENT_UPLOADS` and `CLOUDHAL_AGENT_UPLOAD_BYTES`. Self-host takes the same vars from its environment, and `cloudhal studio` reads them from the project. + - The release key table classes both as `deploy` keys, so `deploy --release` accepts any value. + - **Studio's Activity** labels `create_upload`, `complete_upload` and `asset.upload-received` in every language. Languages other than English are drafts awaiting review. + - **A guide**, `docs/guides/agent-uploads.md`, covers the flow, the settings, the secret and its rotation, keeping `?sig=` out of proxy access logs and `wrangler tail`, and body size limits. The self-host guide and the threat model now list the new settings and the mitigations. + ## 0.11.0 No changes in this release. diff --git a/packages/core-contracts/package.json b/packages/core-contracts/package.json index 02eaa4e5..54e14eac 100644 --- a/packages/core-contracts/package.json +++ b/packages/core-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/core-contracts", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal domain contracts: JSON Schema source of truth plus generated TypeScript types", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/core-ts/CHANGELOG.md b/packages/core-ts/CHANGELOG.md index dbb1bc79..7bebc3c0 100644 --- a/packages/core-ts/CHANGELOG.md +++ b/packages/core-ts/CHANGELOG.md @@ -1,5 +1,92 @@ # @cloudhal/core-ts +## 0.12.0 + +### Minor Changes + +- f215f7d: RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). + + - **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. + - **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. + - **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. + - **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. + - **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. +- 1f2efea: RFC-0045 rollout step 8a: listings by reference (see the RFC's "Amended in 8a"). + + - **A reference field can be a listing field.** Its conditions are `eq`, `ne`, `in`, `set` and `unset` on translation group ids, with a multiple select's meaning for a multiple reference (contains, contains any). There is no ordering and no `all`. The values come from `resolveFields`, so a translation filters by its original's non-localized reference. + - **Member ids read as their group's** in every query path: the store's `queryContentEntries` (API `GET …/entries?where=`, MCP `list_entries`), `contentList` sections (stored as group ids on page writes) and the renderer's `queryEntries`/`contentList`. + - **Rebuild:** `entry_list_values` rows hold reference group ids now, and the list fingerprint's format is 3, so every listed collection is rebuilt once by `lists.backfill` (Cloudflare) or at start-up (`rebuildListValues`, Node). Until then listings answer from the in-memory evaluator. + - **Studio:** a content list condition on a reference picks its entries with the entry picker. A collection list shows a reference column as titles and filters it by a chosen entry. The "Listing fields" warning now names repeaters only. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so reference listing fields and conditions on them stay refused (`reference_listings_unsupported`) until the release that enables step 8. +- 0fb2f95: RFC-0045 rollout step 8b: structured data from references (see the RFC's "Amended in 8b"). + + - **Contract:** a fifth structured-data source, `ReferenceValueSource` (`{ "kind": "reference", "field": "venue", "property": "title" }` or `"targetField": "city"`), and the `ReferenceValueProperty` enum (`title`, `url`, `summary`). + - **Event.location from a venue entry:** a preset can read the entry a single, one-target reference field names. That is the member the page shows (its language, the site's fallback, published and not gated), with a translation's non-localized fields read from its original. Without one, its properties are left out, and a missing required one keeps the `BlogPosting`. + - **Checks:** `structured_data_invalid` when the source names a field that is not such a reference, gives both or neither of `property`/`targetField`, or reads a card property or target field the path does not take. Field operations on the target's field see the presets that read it (rename follows, remove and an unfitting retype are refused). + - **Previews:** MCP `preview_structured_data` and Studio's preview read the working copy's published referenced entries. + - **Studio:** the structured-data card offers "From Venue: Title", "From Venue: City" and the like. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so a write that adds a reference source is refused (`reference_listings_unsupported`) until the release that enables step 8. +- e8eabce: RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). + + - **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. + - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. + - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. + - No venue means no match, `ne` and `unset` included. + - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. + - **Contract:** `FieldCondition.field` accepts one dot. + - **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. + - **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: + - reference listing fields and `contentList` conditions on them (8a); + - `ReferenceValueSource` presets (8b); + - one-hop conditions. + + A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. + - **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. +- c0e8651: RFC-0048 rollout step 2 adds the store side of agents' signed upload links. There are no agent tools or REST route yet; those come in steps 3 and 4. + + - **Migration `0035_agent_uploads`.** This additive migration adds `purpose`, `attempts`, `complete_by`, `received` and `asset_id` to `media_uploads`, plus an index on `(site_id, state)`. Studio's tickets become `purpose = 'studio'` rows and behave as before. Studio's ticket queries now read only those rows. + - **`store.uploads` (`AgentUploads`).** + - `open` creates a row bound to one file: size, type and a required SHA-256. It is created only while the key (10) and the site (50) are under their open limits and the site quota can hold the declared bytes beside the uploads in progress. + - `receive` is the link's PUT. It claims the row with a CAS before reading any byte and stages exactly the declared bytes. Images are buffered and stripped; other files are streamed. A refused PUT reopens the row, up to three attempts. + - `complete` inserts the asset node in one guarded `batch()`. The batch requires the row to be `received` before `completeBy` and the blob to be stored, and anchors the row's `completed` state and the lease release on the new node's hash. Repeating the call returns the same asset. + - `stats` returns the pending uploads, for the daily limit. + - **Staging is split out.** `ingestAsset` and `ingestAssetStream` now run staging (`media/stage.ts`: lease, put, verify, `stored`) and then completion (node and lease release). The agent link runs the two steps separately and holds the lease until `completeBy`. Unfinished uploads are then collected by the existing media garbage collection. + - **Blob leases are never shortened.** `leaseBlob` keeps the longer of the old and new lease. + - **New invariant codes**, with their HTTP statuses: `checksum_mismatch` and `size_mismatch` (400); `upload_used`, `upload_expired` and `too_many_attempts` (410); `too_many_uploads` and `upload_pending` (409). +- 42ee52a: Observability for self-host (#293; RFC-0047 §7a). + - **Traces.** `OTEL_EXPORTER_OTLP_ENDPOINT` takes `https://` too, and `OTEL_EXPORTER_OTLP_HEADERS` adds a backend's headers. Every export carries `x-cloudhal-instance` and `x-cloudhal-version` headers for the collector to turn into resource attributes. + - **Metrics.** The admin Worker gains `GET /api/metrics` (Prometheus text). It is off unless `CLOUDHAL_METRICS_TOKEN` is set, and then answers only that bearer token. It covers requests of the admin and site Workers (the site's through `/__cloudhal/metrics`), publish durations, scheduler lag and health, and store errors. + - **Supporting changes.** `D1Driver` takes an `onError` hook, and `@cloudhal/core-ts` exports the per-isolate counters (`RequestMetrics`, `Histogram`). + - **Recipes.** The compose file gains an `otel` profile (an OpenTelemetry Collector with `otel-collector.yaml`), Caddy no longer serves `/api/metrics` publicly, and the Helm chart gains `otel.headersSecret` and `metrics.enabled`. + +### Patch Changes + +- 71e377e: Graph writes caught while D1 moves (#324) are no longer lost or applied twice. When a write gets D1's transient error (a graceful handoff in a self-host cluster, a deploy or an eviction on Cloudflare), the store reads its aim back: + - the new content hash, or the operation's `op_guards` row, means it applied and is reported as a success; + - the node still at the revision it read means the write was lost, and it runs once more; + - anything else is a `ConflictError`, as for any concurrent change. + + This covers single-node CAS writes, every `OpBatch` operation, site updates and publishes, entry and page deletes, snapshots and scheduled release publishes. `@cloudhal/storage` exports `isTransientD1Error`. +- ae08828: Dependency updates: hono 4.13.23 (`@cloudhal/api`), temporal-polyfill 1.0.8 (`@cloudhal/core-ts`, `@cloudhal/schedules`), and in the starter that `cloudhal init` copies, Astro ^7.4.13 and Tailwind CSS ^4.3.5 (`tailwindcss` with `@tailwindcss/vite`). The Astro peer range of `@cloudhal/astro-renderer` and `@cloudhal/cli` stays `^7.4.0`. +- 3bde876: Studio previews show their images again when Studio and the site are on different hosts (#383). Preview HTML pointed blob images at the site's `/media/…` path, which only the site's host serves; Studio answered it with its own HTML. Previews now name a short-lived signed URL that Studio serves itself, `GET /api/sites/:siteId/preview-media/:assetId/.?v=…&exp=…&sig=…`: HMAC-SHA256 over the site, asset, SHA-256 prefix and expiry, with a key derived (HKDF) from `CLOUDHAL_PREVIEW_SECRET` or else `BETTER_AUTH_SECRET`. The signature is the credential, because the sandboxed preview sends no session cookie and has an opaque origin (the route answers `Cross-Origin-Resource-Policy: cross-origin`). Expiries are bucketed to 6 hours, so re-renders keep the same URL and the browser cache hits. Covers, section images, `asset:` references, Markdown `/media/…` images and drafts' never-published uploads are all rewritten; external images keep their URL. A taken-down file answers 410. The playground routes these URLs to their session without the cookie. +- 4e175b1: `render_page` on self-host through an optional Chrome sidecar (#292). + - **The setting.** `CLOUDHAL_BROWSER_URL` (Chrome's DevTools port) gives the admin Worker a `BROWSER_CDP` binding. + - **The driver.** `@cloudhal/cloudflare`'s new `devtoolsRenderer` drives it with the shared `cdpSession`: one browser context per render, and the shared browser is never closed. + - **What it opens.** `render_page` opens only the page's signed preview link. With `RenderDeps.origin` (`CLOUDHAL_RENDER_ORIGIN`, default `http://cloudhal:8788`) it opens the link at that private origin, so a site without a domain renders too. `@cloudhal/core-ts` gains `previewUrlAt`. + - **The recipes.** The compose file gains a `chrome` profile: no port, and a network shared with Cloudhal only. The Helm chart gains `chrome.*` values: a Deployment, a Service and a NetworkPolicy. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/storage@0.12.0 + - @cloudhal/schedules@0.12.0 + - @cloudhal/core-contracts@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/core-ts/package.json b/packages/core-ts/package.json index 9346ee50..86d1e899 100644 --- a/packages/core-ts/package.json +++ b/packages/core-ts/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/core-ts", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal Site Graph core (TypeScript): load/save nodes with optimistic locking, snapshots, diff, publish and rollback; taxonomies, terms, redirects and menus", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/create-cloudhal/CHANGELOG.md b/packages/create-cloudhal/CHANGELOG.md index ce9ed879..1533dec2 100644 --- a/packages/create-cloudhal/CHANGELOG.md +++ b/packages/create-cloudhal/CHANGELOG.md @@ -1,5 +1,27 @@ # create-cloudhal +## 0.12.0 + +### Patch Changes + +- Updated dependencies [ae08828] +- Updated dependencies [1cde17d] +- Updated dependencies [1c187a4] +- Updated dependencies [b456c34] +- Updated dependencies [ec7ea96] +- Updated dependencies [f215f7d] +- Updated dependencies [e8eabce] +- Updated dependencies [fd496b4] +- Updated dependencies [0842229] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [be8f768] +- Updated dependencies [daf3dad] +- Updated dependencies [88ebb41] +- Updated dependencies [d53e5c0] +- Updated dependencies [43e6199] + - @cloudhal/cli@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/create-cloudhal/package.json b/packages/create-cloudhal/package.json index 4c0011b1..18e3b5ee 100644 --- a/packages/create-cloudhal/package.json +++ b/packages/create-cloudhal/package.json @@ -1,6 +1,6 @@ { "name": "create-cloudhal", - "version": "0.11.0", + "version": "0.12.0", "description": "Create a Cloudhal site: npm create cloudhal@latest", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/mcp-server/CHANGELOG.md b/packages/mcp-server/CHANGELOG.md index 90c84fc4..4c107b5e 100644 --- a/packages/mcp-server/CHANGELOG.md +++ b/packages/mcp-server/CHANGELOG.md @@ -1,5 +1,92 @@ # @cloudhal/mcp-server +## 0.12.0 + +### Minor Changes + +- 40f7494: New read-only MCP tool `pending_changes` (`site:read`, #279): before `publish`, an agent sees what publishing the current state would change against the live version, without snapshot ids. It returns the counts, the same lines the person is asked to approve, every node (up to 200) with the top-level fields that changed (any node kind; publish bookkeeping left out), and `approval`: whether the caller's `publish` would go live at once, wait for a person (with the reason, and in `auto` mode the rule that stopped it) or be refused. It runs the same gate as `publish` (the policy's decision, the own-only rule, `auto` mode's low-risk check), now shared in `publish-gate.ts`. `diff_node` now compares fields as canonical JSON, so key order no longer reads as a change. +- 311da20: RFC-0048 rollout step 4: agents can now upload large files from disk without base64. + + - **`create_upload`** (scope `asset:upload`, gated like `upload_asset`) takes a file's exact size, type and SHA-256 and returns a 10-minute PUT link with a ready `curl` line. When the library already holds those bytes, it answers `status: "existing"` with the asset instead. + - **`complete_upload`** turns the received bytes into the asset and answers as `upload_asset` does. It asks for no second approval: it is refused in `plan` and free in `manual`. Calling it again returns the same asset. + - **Schemas.** Optional inputs accept `null`. The output follows the strict profile: every key is always present, `null` where it does not apply. + - **`get_mode.uploads`** reports `{signedUrl, maxBytes, linkSeconds}`. Links are off on stdio `cloudhal mcp`, without a shared signing secret, or with `media.agentUploads: false`. The per-file cap is `media.agentUploadBytes`: 25 MB by default, at most 100 MB. The server instructions mention `create_upload` only where links are on. + - **Refusals** (`upload-hints.ts`) use existing tool codes with a `details.reason`: `upload_cap`, `unsupported_type`, `checksum_required`, `too_many_uploads` (10 open per key, 50 per site), `quota_exceeded`, `signed_upload_unsupported`, `upload_pending`, `upload_failed`, `too_many_attempts`, `upload_not_found` and `upload_expired`. Each comes with the agent's next step. + - **The daily limit** (100 files, 500 MB) now counts open uploads with their declared bytes. + - **Audit rows** name the upload and never hold the link. + - **The README tool table** is regenerated. + - **The API** passes `/mcp` the link signer, whether the secret is shared, and the configured origin. Links point at the configured origin, else at the `/mcp` request's. +- 4e175b1: `render_page` on self-host through an optional Chrome sidecar (#292). + - **The setting.** `CLOUDHAL_BROWSER_URL` (Chrome's DevTools port) gives the admin Worker a `BROWSER_CDP` binding. + - **The driver.** `@cloudhal/cloudflare`'s new `devtoolsRenderer` drives it with the shared `cdpSession`: one browser context per render, and the shared browser is never closed. + - **What it opens.** `render_page` opens only the page's signed preview link. With `RenderDeps.origin` (`CLOUDHAL_RENDER_ORIGIN`, default `http://cloudhal:8788`) it opens the link at that private origin, so a site without a domain renders too. `@cloudhal/core-ts` gains `previewUrlAt`. + - **The recipes.** The compose file gains a `chrome` profile: no port, and a network shared with Cloudhal only. The Helm chart gains `chrome.*` values: a Deployment, a Service and a NetworkPolicy. + +### Patch Changes + +- f215f7d: RFC-0045 rollout step 8.0: hardening and the capability for listings and structured data by reference (see the RFC's "Amended in 8"). + + - **`list_field_type` (422).** A field whose type takes no operator can no longer be newly listed in `listFields`. That is a repeater, always, and a reference until listings by reference arrive (8a). Before, any field was accepted and got rows that no query could read. A type change of a listed field into one of these types is refused the same way. + - **Existing listings are kept.** A collection that already lists a repeater or a reference keeps it through unrelated writes, and bundles that hold one import as they are. `cloudhal import --dry-run` and Studio's "Listing fields" now name such fields, and Studio's picker no longer offers them. + - **`fields: 3`, defined but not reported yet.** `FieldTypeSupport.supported(siteId, version)` takes a version: `REFERENCE_TYPES_VERSION` (2, the default) for the two types, `REFERENCE_LISTINGS_VERSION` (3) for step 8. The admin Worker keeps the highest version per site Worker (`SiteConfirmations.fields` now holds numbers). The site Worker still reports `fields: 2`; the last step-8 PR raises it. + - **`reference_listings_unsupported` (409).** One gate (`references/listing-gate.ts`) refuses a reference list field, and a `contentList` condition or order on a reference field, unless the site's renderer reports 3. It runs on site writes, page writes, field operations and bundles (import, push, pull, restore). Interactive writes refuse only what they add; bundles count every use. Node and the playground (`FIELDS_SUPPORTED`) accept every version. + - **Nothing changes on Cloudflare yet.** A site Worker at 2 keeps taking reference and repeater fields; step 8's listings stay refused there until the release that enables them. +- 1f2efea: RFC-0045 rollout step 8a: listings by reference (see the RFC's "Amended in 8a"). + + - **A reference field can be a listing field.** Its conditions are `eq`, `ne`, `in`, `set` and `unset` on translation group ids, with a multiple select's meaning for a multiple reference (contains, contains any). There is no ordering and no `all`. The values come from `resolveFields`, so a translation filters by its original's non-localized reference. + - **Member ids read as their group's** in every query path: the store's `queryContentEntries` (API `GET …/entries?where=`, MCP `list_entries`), `contentList` sections (stored as group ids on page writes) and the renderer's `queryEntries`/`contentList`. + - **Rebuild:** `entry_list_values` rows hold reference group ids now, and the list fingerprint's format is 3, so every listed collection is rebuilt once by `lists.backfill` (Cloudflare) or at start-up (`rebuildListValues`, Node). Until then listings answer from the in-memory evaluator. + - **Studio:** a content list condition on a reference picks its entries with the entry picker. A collection list shows a reference column as titles and filters it by a chosen entry. The "Listing fields" warning now names repeaters only. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so reference listing fields and conditions on them stay refused (`reference_listings_unsupported`) until the release that enables step 8. +- 0fb2f95: RFC-0045 rollout step 8b: structured data from references (see the RFC's "Amended in 8b"). + + - **Contract:** a fifth structured-data source, `ReferenceValueSource` (`{ "kind": "reference", "field": "venue", "property": "title" }` or `"targetField": "city"`), and the `ReferenceValueProperty` enum (`title`, `url`, `summary`). + - **Event.location from a venue entry:** a preset can read the entry a single, one-target reference field names. That is the member the page shows (its language, the site's fallback, published and not gated), with a translation's non-localized fields read from its original. Without one, its properties are left out, and a missing required one keeps the `BlogPosting`. + - **Checks:** `structured_data_invalid` when the source names a field that is not such a reference, gives both or neither of `property`/`targetField`, or reads a card property or target field the path does not take. Field operations on the target's field see the presets that read it (rename follows, remove and an unfitting retype are refused). + - **Previews:** MCP `preview_structured_data` and Studio's preview read the working copy's published referenced entries. + - **Studio:** the structured-data card offers "From Venue: Title", "From Venue: City" and the like. + - **On Cloudflare nothing changes yet:** the site Worker still reports `fields: 2`, so a write that adds a reference source is refused (`reference_listings_unsupported`) until the release that enables step 8. +- e8eabce: RFC-0045 rollout step 8c: filter by a referenced entry's field, and listings and structured data by reference enabled on Cloudflare (see the RFC's "Amended in 8c"). + + - **One hop through a reference:** a listing condition can name `.`, as in `{"field":"venue.city","op":"eq","value":"Istanbul"}`. + - The reference must be a listed one with one target collection. The field must be a listing field of that collection (not a reference), and its type's operators apply. The condition counts toward the four. + - The venue that counts is the one the view shows, in the entry's language (the default language's under `default-with-notice`). On the site that means published and not gated; in Studio, the API and `list_entries`, any member that is not archived. + - No venue means no match, `ne` and `unset` included. + - It is answered by a join over `entry_list_values`, so a venue's edit shows in the next listing. Sorting by a referenced field is not offered. + - **Contract:** `FieldCondition.field` accepts one dot. + - **Guards:** while a section filters through a reference, unlisting, removing or retyping the target's field or the reference is refused (`list_field_in_use`), as is pointing the reference at other collections. A rename of either rewrites the condition. + - **Enabled on Cloudflare:** the site Worker now reports `fields: 3`. Once it is deployed (`cloudhal deploy`), its sites accept: + - reference listing fields and `contentList` conditions on them (8a); + - `ReferenceValueSource` presets (8b); + - one-hop conditions. + + A site still served by an older site Worker answers `409 reference_listings_unsupported`. Node and the playground take them as before. + - **Not yet:** Studio's condition builder offers no one-hop fields; agents and the API write them, and Studio keeps them. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [ae08828] +- Updated dependencies [1cde17d] +- Updated dependencies [ec7ea96] +- Updated dependencies [3bde876] +- Updated dependencies [f215f7d] +- Updated dependencies [1f2efea] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [0842229] +- Updated dependencies [4e175b1] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/core-ts@0.12.0 + - @cloudhal/storage@0.12.0 + - @cloudhal/schedules@0.12.0 + - @cloudhal/astro-renderer@0.12.0 + - @cloudhal/core-contracts@0.12.0 + - @cloudhal/comments@0.12.0 + - @cloudhal/agent-runtime@0.12.0 + - @cloudhal/analytics@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 4768c6d8..6510d040 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/mcp-server", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal MCP server: semantic site tools (pages, articles, snapshots, preview, publish) governed by the policy engine", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/release-verify/CHANGELOG.md b/packages/release-verify/CHANGELOG.md index f4a9324c..547f74c7 100644 --- a/packages/release-verify/CHANGELOG.md +++ b/packages/release-verify/CHANGELOG.md @@ -1,5 +1,22 @@ # @cloudhal/release-verify +## 0.12.0 + +### Patch Changes + +- fd496b4: RFC-0048 rollout step 5 finishes agents' signed upload links on every host. + + - **Compatibility (`@cloudhal/release-verify`, `@cloudhal/core-contracts`):** verifiers before 0.12 refuse 0.12+ manifests; update the verifier with the CLI. The release manifest's `SecretName` gains `CLOUDHAL_UPLOAD_SECRET`, which 0.12+ manifests list for the admin Worker, and an older verifier rejects the unknown value. The new schema still verifies older bundles. Portable copies of the schema need the new `release-manifest` fingerprint (RFC-0046, amended). + - **`CLOUDHAL_UPLOAD_SECRET`:** + - `cloudhal deploy` generates it once into `.cloudhal/deploy/secrets.json` (0600) and gives it to the admin Worker. It signs upload tickets and agents' upload links ahead of the preview secret, so it can rotate on its own. + - The release manifest's `SecretName` gains it, an additive contract change. + - On self-host it is optional, with `_FILE` supported. `cloudhal selfhost secrets` generates it for new installations; when unset, the preview secret signs; a value shorter than 32 characters stops the image at start. The compose file passes it through. + - **`cloudhal.json` `media.agentUploads: false`** turns the links off, and **`media.agentUploadBytes`** caps a file (25 MB by default, at most 100 MB). + - They become the admin Worker's vars `CLOUDHAL_AGENT_UPLOADS` and `CLOUDHAL_AGENT_UPLOAD_BYTES`. Self-host takes the same vars from its environment, and `cloudhal studio` reads them from the project. + - The release key table classes both as `deploy` keys, so `deploy --release` accepts any value. + - **Studio's Activity** labels `create_upload`, `complete_upload` and `asset.upload-received` in every language. Languages other than English are drafts awaiting review. + - **A guide**, `docs/guides/agent-uploads.md`, covers the flow, the settings, the secret and its rotation, keeping `?sig=` out of proxy access logs and `wrangler tail`, and body size limits. The self-host guide and the threat model now list the new settings and the mitigations. + ## 0.11.0 No changes in this release. diff --git a/packages/release-verify/package.json b/packages/release-verify/package.json index a53b1c26..7a0a245f 100644 --- a/packages/release-verify/package.json +++ b/packages/release-verify/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/release-verify", - "version": "0.11.0", + "version": "0.12.0", "description": "Verifies a Cloudhal release bundle (RFC-0046 §2, §7, §11a): the Ed25519 release statement against pinned keys, the manifest, and every part of the tarball. Worker-safe; the attestation check is a Node-only subpath.", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/schedules/CHANGELOG.md b/packages/schedules/CHANGELOG.md index fb971971..1d6860e0 100644 --- a/packages/schedules/CHANGELOG.md +++ b/packages/schedules/CHANGELOG.md @@ -1,5 +1,21 @@ # @cloudhal/schedules +## 0.12.0 + +### Patch Changes + +- ae08828: Dependency updates: hono 4.13.23 (`@cloudhal/api`), temporal-polyfill 1.0.8 (`@cloudhal/core-ts`, `@cloudhal/schedules`), and in the starter that `cloudhal init` copies, Astro ^7.4.13 and Tailwind CSS ^4.3.5 (`tailwindcss` with `@tailwindcss/vite`). The Astro peer range of `@cloudhal/astro-renderer` and `@cloudhal/cli` stays `^7.4.0`. +- Updated dependencies [71e377e] +- Updated dependencies [4360189] +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [c0e8651] +- Updated dependencies [fd496b4] +- Updated dependencies [42ee52a] +- Updated dependencies [b16a16e] + - @cloudhal/storage@0.12.0 + - @cloudhal/core-contracts@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/schedules/package.json b/packages/schedules/package.json index c1a34f1f..75eee45f 100644 --- a/packages/schedules/package.json +++ b/packages/schedules/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/schedules", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal schedules (RFC-0008): the time model, the RRULE subset and its sentences, releases (pin, closure, rl1: hash, compose, conflicts, state machine), automation and run state, taint and budget accounting, the Scheduler and runDue, and the SQLite/D1 store. Worker-safe.", "license": "Apache-2.0", "homepage": "https://cloudhal.dev", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index f6d93268..c92a111e 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,41 @@ # @cloudhal/storage +## 0.12.0 + +### Minor Changes + +- c0e8651: RFC-0048 rollout step 2 adds the store side of agents' signed upload links. There are no agent tools or REST route yet; those come in steps 3 and 4. + + - **Migration `0035_agent_uploads`.** This additive migration adds `purpose`, `attempts`, `complete_by`, `received` and `asset_id` to `media_uploads`, plus an index on `(site_id, state)`. Studio's tickets become `purpose = 'studio'` rows and behave as before. Studio's ticket queries now read only those rows. + - **`store.uploads` (`AgentUploads`).** + - `open` creates a row bound to one file: size, type and a required SHA-256. It is created only while the key (10) and the site (50) are under their open limits and the site quota can hold the declared bytes beside the uploads in progress. + - `receive` is the link's PUT. It claims the row with a CAS before reading any byte and stages exactly the declared bytes. Images are buffered and stripped; other files are streamed. A refused PUT reopens the row, up to three attempts. + - `complete` inserts the asset node in one guarded `batch()`. The batch requires the row to be `received` before `completeBy` and the blob to be stored, and anchors the row's `completed` state and the lease release on the new node's hash. Repeating the call returns the same asset. + - `stats` returns the pending uploads, for the daily limit. + - **Staging is split out.** `ingestAsset` and `ingestAssetStream` now run staging (`media/stage.ts`: lease, put, verify, `stored`) and then completion (node and lease release). The agent link runs the two steps separately and holds the lease until `completeBy`. Unfinished uploads are then collected by the existing media garbage collection. + - **Blob leases are never shortened.** `leaseBlob` keeps the longer of the old and new lease. + - **New invariant codes**, with their HTTP statuses: `checksum_mismatch` and `size_mismatch` (400); `upload_used`, `upload_expired` and `too_many_attempts` (410); `too_many_uploads` and `upload_pending` (409). +- 42ee52a: Observability for self-host (#293; RFC-0047 §7a). + - **Traces.** `OTEL_EXPORTER_OTLP_ENDPOINT` takes `https://` too, and `OTEL_EXPORTER_OTLP_HEADERS` adds a backend's headers. Every export carries `x-cloudhal-instance` and `x-cloudhal-version` headers for the collector to turn into resource attributes. + - **Metrics.** The admin Worker gains `GET /api/metrics` (Prometheus text). It is off unless `CLOUDHAL_METRICS_TOKEN` is set, and then answers only that bearer token. It covers requests of the admin and site Workers (the site's through `/__cloudhal/metrics`), publish durations, scheduler lag and health, and store errors. + - **Supporting changes.** `D1Driver` takes an `onError` hook, and `@cloudhal/core-ts` exports the per-isolate counters (`RequestMetrics`, `Histogram`). + - **Recipes.** The compose file gains an `otel` profile (an OpenTelemetry Collector with `otel-collector.yaml`), Caddy no longer serves `/api/metrics` publicly, and the Helm chart gains `otel.headersSecret` and `metrics.enabled`. + +### Patch Changes + +- 71e377e: Graph writes caught while D1 moves (#324) are no longer lost or applied twice. When a write gets D1's transient error (a graceful handoff in a self-host cluster, a deploy or an eviction on Cloudflare), the store reads its aim back: + - the new content hash, or the operation's `op_guards` row, means it applied and is reported as a success; + - the node still at the revision it read means the write was lost, and it runs once more; + - anything else is a `ConflictError`, as for any concurrent change. + + This covers single-node CAS writes, every `OpBatch` operation, site updates and publishes, entry and page deletes, snapshots and scheduled release publishes. `@cloudhal/storage` exports `isTransientD1Error`. +- 4360189: `D1Driver` retries a read-only `get` or `all`, about 2 s in all, when D1 lost the request in transit ("Network connection lost", a Durable Object reset). This happens when D1's object moves: on Cloudflare after a deploy or an eviction, and in a self-host cluster on every graceful handoff (RFC-0047 §7). The cluster failover test (#290) found it as one 503 page during a SIGTERM. Writes and batches are never retried, because a lost write may still have been applied. `readRetryDelaysMs: []` turns the retries off. +- b16a16e: `cloudhal studio` on Node no longer fails a sign-up (422 "Failed to create user: database is locked") when the store writes during it (#342). Better Auth and the store hold two connections to the project's `data.db`. A Better Auth transaction spans awaits (a sign-up reads, hashes the password, then writes), and a store write in between made its snapshot stale, or, once it had written, had to wait for SQLite's lock with the event loop blocked. Each SQLite file now has one in-process lock (`sqliteFileLock`, `@cloudhal/storage/sqlite`): Better Auth's transactions hold it from `BEGIN IMMEDIATE` to `COMMIT`, the store's driver takes it for each statement, and it is re-entrant inside a transaction. Both connections set a 5 s busy timeout for writers in other processes. Cloudflare and the workerd self-host image (D1) are not affected. +- Updated dependencies [0fb2f95] +- Updated dependencies [e8eabce] +- Updated dependencies [fd496b4] + - @cloudhal/core-contracts@0.12.0 + ## 0.11.0 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index cf7f1f83..9092fd43 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@cloudhal/storage", - "version": "0.11.0", + "version": "0.12.0", "description": "Cloudhal storage interfaces (SQL driver, blob store) with Cloudflare D1/R2/Durable Object SQLite and local SQLite/filesystem adapters", "license": "Apache-2.0", "homepage": "https://cloudhal.dev",