Skip to content

feat: Blocks v8 in Studio — content protocol, deco serve, hosted publish and releases, site tokens - #8062

Merged
tlgimenes merged 23 commits into
mainfrom
feat/blocks-v8-hosted
Oct 19, 2026
Merged

tlgimenes merged 23 commits into
mainfrom
feat/blocks-v8-hosted

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Blocks v8 in Studio, server and editor in one PR: the content protocol (GitHub, sandboxes, a local deco serve), hosted Deco CMS drafts, Publish and Releases, and site tokens.

This replaces #7887 (API) and #7888 (web), which stacked on each other; both stay open for the PO to close. The history of each is on backup/fold-v8-api-2026-10-19, backup/fold-v8-web-2026-10-19 and backup/feat-blocks-v8-hosted-2026-10-19.

Commits

  1. The 20 API commits of feat(api): Blocks v8 server side — content protocol (GitHub + sandbox over the daemon's fs routes), hosted releases and site tokens #7887, replayed one by one on origin/main (no conflicts).
  2. feat(web): the editor side, squashed (see "Rebased on main after fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027").
  3. test(e2e): the e2e side of the same commits.
  4. chore: @decocms/blocks 8.2.1 → 8.4.0.

PO decisions this implements

  • The sandbox daemon only does fs and git; every other API lives in Studio's backend. git diff origin/main -- packages/sandbox is empty.

  • v8 is decided per site, from main's schema. isV8Schema (@decocms/shared/blocks-major) is true when .deco/schema.gen.json has "blocksMajor": 8. There is no org flag. The blocksMajor marker on a project only caches that answer; it never makes a site v8.

  • Staging and prod share the site-token signing key and the R2 delivery bucket. No kill switch: a site leaves v8 when its main schema goes back to v7.

  • The editor waits for both a schema and the content for its mode, then decides (PO 2026-10-12), and never renders the v7 path first:

    Mode When Schema from v8 not v8
    Localhost a deco serve connection is chosen, or the account-less /site-editor the deco serve content protocol on the deco serve guided "not v8" state
    Sandbox the session has a sandbox the sandbox working tree, through /sandbox/:id/:branch/rpc content protocol over the daemon's fs routes the existing v7 sandbox path
    GitHub otherwise main, through schema.get on /decofile/:id/main/rpc main + CDN draft (hosted CMS) content from the branch, as on main
  • Discard on hosted v8 removes the blocks from the draft ({set, delete} layered over main's current snapshot); there is no main sync. It runs in the editor's per-block write queue, so armed autosaves of those blocks are dropped. v7 discard is unchanged.

  • Releases: "Reapply version" rolls forward (PO 2026-10-14). It makes a new version with that version's content (POST …/releases/:sha/reapply); latest.json never moves back. A version made for another schema is reapplied anyway, and the dialog adds one calm line ("If something doesn't look right afterwards, reapply the version you have now to go back"). Rows read "Reapply: "; the Latest pill marks what latest.json names. No served-revision reads, no "Going live…".

  • Differences a v7 user can see: A1–A4, A6–A8, A10–A13 and A23 approved (2026-10-14). A9 is main's behaviour (no 3-level cap on a recursive $ref).

  • Who made the other change, and when: hosted v8 only (PO 2026-10-16: "only have metadata and changed by on v8 hosted"). See the conflict dialog section.

What's in it

  • packages/shared: the one v8 detector (blocks-major.ts, with a guard test against any other), Fast Preview always on for a v8 project with a preview server, the sealed-box secret format, site-editor reserved as an org slug, and the releases sidebar view.
  • Content protocol over GitHub: POST /api/:org/decofile/:id/:branch/rpc serves the Blocks content protocol (createContentHandler from @decocms/blocks/protocol/server) over the repository, plus hosted draft publish. A v7 main gets a read-only answer with schema: null. A site owned by another project gets 409 site_not_owned; an unconfigured bucket 503 hosted_delivery_unconfigured.
  • Content protocol in a sandbox: /api/:org/sandbox/:id/:branch/rpc runs the same core over the daemon's existing read/write/unlink/bash routes. One bash call per listing (git's index for unchanged files, hash-object for the rest), written to a file that ends with @end so a cut listing is refused; reads 8 at a time; applies serialized per sandbox and put back on failure. About 0.1 s per listing on a 3,000-block repo. Remaining cost: one daemon task per listing (about one log line and two SSE broadcasts every 2 s per open editor).
  • Hosted Deco CMS (hosted/): the R2 delivery bucket and CDN purge, drafts, Publish, Releases (reapply, releases/retry) and Ed25519 site tokens. Config: DELIVERY_R2_*, DECO_SITE_TOKEN_SIGNING_KEY, CF_DELIVERY_ZONE_ID/CF_PURGE_API_TOKEN; unset means "not configured" answers. Project create claims a free site slug; POST /api/_admin/hosted/site-claims/backfill (dry run by default) links existing v8 projects.
  • Editor: one content-protocol client for the sections editor, the Content tab and Preview; v8 schema shapes and a schemaless editor; secrets encrypted in the browser; asset uploads; deco serve discovery, connect links, first-run guide and the account-less /site-editor; Publish, the Versions tab and site tokens on hosted v8; a guided state when another project owns the site. Every message in business language, one toast per action.
  • v7 projects behave as on main, except the managed assets' public base defaults to https://assets.decocms.com, and a new thread on an unmarked repo-backed project may read main's head once (ETag-cached) to check for v8.

Conflict dialog and concurrent saves

The v7 part is #8027 as it shipped on main (fbb64f098): one save at a time per form, values only one side changed merged silently, and a same-field conflict opens a must-answer alert dialog with yours preselected: two cards (You / Someone else), one field per step with the stepper (dots, "N of M", Back), Next on every step and OK on the last (one field: OK), no "Use theirs for all", and the merge toast "Someone else also edited this block. Both changes were kept." This PR keeps that code exactly as main has it.

The v8 additions on top:

  • ifMatch guard: every v8 section save sends the content protocol's ifMatch with the version the form's copy was checked against (formSaveGuard); a refused save behaves like fix(decofile): stop stale editor copies from reverting other drafts' block changes #7909's 409 on v7 (re-read, retry once on the stored block, the same dialog for same-field changes).

  • Names, on hosted v8 drafts only: the draft object's x-amz-meta-deco-edited metadata records who changed each block and when (never in the draft's JSON); the session read answers changedBy, and the editor resolves people from the org's members.

    ┌ Ana changed the title while you were editing ──────────────┐
    │ Pick the one to keep. The other is discarded.              │
    │ ┏ (D) You  Your version · not saved yet ━━━━━━━━━━━━━━━━━┓ │
    │ ┃     Register [today] and Save [Big!]                   ┃ │
    │ ┌ (AS) Ana Souza  saved 3 minutes ago ───────────────────┐ │
    │ │     Register [now] and Save [Big this Summer!]         │ │
    │                                                      [OK]  │
    

    Their card shows the member's avatar, name and "saved 3 minutes ago" (exact time on hover); the steps read "Ana also changed the title" and the summary "Title: Ana's". The viewer's own change: "You changed the title in another tab or window". Only the time known: "Someone else", "saved 5 minutes ago". Fast Preview (v7), Localhost and sandboxes show the v7 dialog unchanged.

Rebased on main after #8027 (2026-10-19)

@decocms/blocks 8.4.0

api, web and e2e move from 8.2.1 to 8.4.0. Studio imports only /protocol, /protocol/server, /protocol/storage/fs, /protocol/keys, /protocol/conformance and /secrets, which are unchanged between the two (8.3.0/8.4.0 add /image, /preview and /vite, the NODE_ENV dev default, schema --check and multivariate first-match, and an optional vite peer). No code changes; bun.lock gains only the @decocms/blocks entries and passes bun install --frozen-lockfile.

Checks

  • packages/shared, apps/api, apps/web and packages/e2e typecheck (tsc, single-threaded); oxlint, biome and knip are clean.
  • Unit tier with CI's ignore patterns, 2 GB cap: the web suite 4858 pass, 0 fail (--parallel=2); the api, migrations, packages, plugins and scripts suites 6896 pass, 0 fail (one worker: with --parallel=2 under the 2 GB cap, Bun 1.4.2 itself segfaults in a worker, "This indicates a bug in Bun"; CI is the reference run).
  • e2e on a production web build of 1897791a0 (shared Postgres/NATS, clean database and streams per run, 4 workers): site-editor-stale-form + content-protocol-deco-serve 24/24; content-protocol-github (hosted drafts, Publish, Releases, the hosted "changed by" case) + decofile-api + fast-preview-git-sync 44/44; cms-publish-stages + cms-publish-surface + hosted-runtime-boundary 10/10.
  • PR CI at 1897791a0: all 21 checks pass (typecheck, lint, format, build, test 39299165577, web-component-tests, e2e shards 1 and 2 39299165668, storage-integration 39299165474, daemon-e2e, docker-smoke, multi-pod, CodeQL, Gitleaks). Mergeable.

🤖 Generated with Claude Code

https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

tlgimenes and others added 23 commits October 19, 2026 14:49
…ciphertext

- blocks-major: the one place that decides whether a project is a Blocks v8
  site (isV8Schema / isBlocksV8Project), with a guard test that no other file
  decides v8 or reads meta.gen.json for it.
- session-runtime: a v8 project (server-managed blocksMajor: 8) with a preview
  server always has Fast Preview; v7 keeps its switch, unchanged.
- secret-ciphertext: the sealed-box format shared by the server and editor.
- site-editor is a reserved organization slug (it is a top-level route).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…ite tokens

Server side of Blocks v8 (no UI calls any of it yet; v7 projects are
unchanged):

- decofile routes: POST /api/:org/decofile/:id/:branch/rpc serves the
  Blocks content protocol (createContentHandler from @decocms/blocks) over
  the repository (decofile/repo-content-storage.ts), plus hosted draft
  publish and its status. gen-artifact.ts is the shared blocks.gen.json
  regeneration and commit message the commit coalescer now uses.
- hosted/: the delivery bucket (R2 through its S3 API) and its CDN purge,
  drafts, releases (list + roll back the current one), publish, site
  tokens (Ed25519), the v8 scope checks and the blocksMajor marker that
  caches main's isV8Schema answer on the project. Unconfigured (no
  DELIVERY_R2_* / DECO_SITE_TOKEN_SIGNING_KEY) they answer 'not configured'.
- /api/:org/hosted/:id/{releases,site-tokens}; admin backfill route that
  links existing v8 projects to their org_sites row and syncs the marker.
- project create claims a free site slug for its org (never another org's,
  a deleted org's, or a deco.cx one) and gives a linked site its managed
  asset config; the deco.cx import shares that config code
  (file-storage/managed-site-config.ts). A new thread on an unmarked
  repo-backed project checks for v8 first (bounded) so it gets the cms
  runtime for life.
- the managed assets' public base defaults to https://assets.decocms.com.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…utes

The sandbox daemon stays files and git only (packages/sandbox untouched).

POST /api/:org/sandbox/:id/:branch/rpc now runs the same protocol core
GitHub mode uses (createContentHandler) over a new storage,
apps/api/src/sandbox/content-storage.ts, backed by the daemon's existing
authed routes:

- listing: one /_sandbox/bash call hashes `.deco/blocks/*.json` and the
  schema/secrets files with `git hash-object` (exact git-blob versions of the
  uncommitted working tree; the daemon has no stat route);
- reads: /_sandbox/read in parallel, only for versions the core's per-sandbox
  body cache lacks (handlers stay warm per claim, LRU of 16);
- apply: under a per-sandbox lock, a fresh listing checks every expected
  version and the schema's (stale -> the protocol's Conflict/retry), then
  ordered /_sandbox/write and /_sandbox/unlink calls, rolled back on failure;
  the listing cache is invalidated after every write.

The daemon e2e conformance suite moves with it: the published conformance
suite, the byte-for-byte parity run against the reference fs server and the
sandbox-specific cases now run against the Studio route, over an in-process
stand-in for the daemon's fs routes (unit) and over the real main daemon
(content-storage.daemon.e2e.test.ts, run by the Sandbox workflow).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…f failing

The sandbox listing is reused for 250 ms. When the agent wrote a block in
that window and the core had to read its body, the bytes never matched the
reused listing, so all three of the core's snapshots saw the same stale
versions and the poll failed with "saved blocks kept changing while being
read". A body that disagrees with the listing now drops it, so the core's
next snapshot is fresh. Found by driving the real main daemon with an agent
writing through /_sandbox/write while the editor polled and saved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
… coded

The decofile routes now answer {error, code: "no_repository"} (the editor
reads that code as a v7 answer), so the spec expects the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
… back the file in flight

- The listing no longer travels through /_sandbox/bash stdout, where the
  daemon keeps only the last 256 KiB: big sites lost the head of it, and past
  ~6.4k blocks it parsed as an empty site that an apply could overwrite. The
  command writes it to a file in the sandbox's tmp and prints its path; Studio
  reads it back through /_sandbox/read. A `truncated` answer is refused, and the
  listing (one `<hash> <path>` line per file, then `@end`) is refused unless
  complete, so a cut can never read as a short or empty site.
- Hashes come from git's index for the files git's own path + mtime + size
  check says are unchanged, and `git hash-object` runs only on changed,
  untracked or filtered files. The task's output is one line, so a retained
  daemon task costs almost nothing.
- commit() marks each file as touched before its daemon call, so a write or
  unlink that landed but then timed out or lost its connection is rolled back
  with the rest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
A discard in the v8 editor writes main's version of a block back through
blocks.apply. applyAttemptToDraft now drops the draft entry when the put
equals main's one file for that name (by blob sha, else as JSON values)
instead of keeping a copy, which would shadow a later change on main and
never let the draft be empty. The write reports main's version for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…flip

Releases no longer move latest.json back to an older commit. Republishing a
release (POST hosted/:vmcp/releases/:sha/republish) commits that release's
.deco/blocks/*.json on main (only the files that differ: copied from the
release's commit, blocks added since deleted; schema, index.ts and the rest
of the code untouched), then runs Publish's release path (companion release,
latest.json, purge), with the same main-moved conflict check. A release made
for another schema asks again (409 schema-mismatch) and goes live once
confirmed.

The message follows git's revert convention: "Republish: <note>", never
chained, "Republish: release from <date UTC>" for a release without a note,
plus a Republished-From: <sha> trailer that Releases returns as
`republishOf`.

Releases also returns `serving`: the release the site reports serving, from
its telemetry in the stats lake (deco.release on the upstream-fetch
histogram and the error logs, last 15 min; a bundled snapshot's content
revision is matched to the newest release with that content). A source
that fails (no grant on the histogram yet, a timeout) is skipped; none
answering is `{ source: "none" }`, the pointer fallback.

makeCurrent and its { sha, confirm } route are gone; releases/current keeps
only { head: true }, Publish's "Try again". Content clients gain
readCommit; insights commits carry the message body.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…ds; releases/retry

Reapplying a version (POST hosted/:vmcp/releases/:sha/reapply) still rolls
forward: a new commit on main with that version's .deco/blocks/*.json (only
the files that differ), then Publish's release path with the same main-moved
check. A version made for another schema is no longer refused or asked
about twice: it is reapplied, and the result carries `schemaChanged` (also
logged) so the screen can say how to go back. GET releases/:sha/reapply
answers `{ schemaChanged }` before the user confirms: it compares the
schema's blob ids at both commits and only hashes the schemas when they
differ (a formatting-only change is not a change).

The message is "Reapply: <note>" (never chained; "Reapply: version from
<date> UTC" without a note) with a Reapplied-From: <sha> trailer, returned
by Releases as `reapplyOf`.

Releases no longer reads what the site serves: hosted/serving.ts and the
`serving` field are gone. `current` is the latest.json pointer, nothing
more. Publish's "Try again" moves from releases/current to releases/retry
(releaseMainHead); releases/current no longer exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…s date

reapplyVersion looked for .deco/schema.gen.json in listDecofileEntries,
which (on GitHub, GitLab and Bitbucket) lists only blocks.gen.json and
.deco/blocks/*, so schemaChanged was always false and the toast never
said how to go back. Both the check and the reapply now read the schema's
entry with getEntriesAtPaths. The test fake's listDecofileEntries now lists
what the real providers list, which is what hid this.

Releases also reads the date of a reapplied version's original when it is
not on the same page (one commit read each), so the row can still say
"Same content as the version from <date>".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
….2.1)

Pins @decocms/blocks to 8.2.1 (content protocol 1.1) and gives both
Studio content storages the three new primitives, so changes.list,
changes.get and changes.discard answer on every v8 source.

- Hosted: the base is main's head. The changes are the files the draft
  makes differ from main (its own names; a set byte-equal to main isn't
  one), base bodies come from main by blob sha, and a discard drops the
  names from the draft so main shows through whatever its bytes or
  spellings. expectedBase is checked against main, and a discard's
  expected versions inside the draft lock.
- Sandbox: the base is HEAD, read in the same listing (one bash call per
  poll): commit, branch, ls-tree blob ids, and git's filters confirm
  files that only differ by a checkout conversion. Base bodies come from
  cat-file --filters as base64. A discard unstages what it restores
  (reset / rm --cached, both sides of a staged rename) and puts the index
  back if a write fails, as deco serve 8.2.1 does. No daemon changes.
- The v7-main storage answers an empty base.
- The v8 answers on /git/status, /git/diff and /git/discard are gone:
  hosted/draft-publish-status.ts is deleted and sandbox-proxy.ts is back
  to main's text for those routes; the editor uses changes.* instead.

Tests: the published 8.2.1 conformance suite (changes cases included)
over hosted (stub main + draft store, baseEntry) and sandbox (committed
base, and an unborn one), the parity run with changes.* calls against a
deterministic commit, CRLF, unstaging, app root and stale-base cases;
the same suites pass over the real Go daemon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…p unused exports

The hosted discard case the web branch carried (it drove the deleted
draftGitDiscard) now discards through the content protocol, and checks
the discard's revision is the next read's. draftFileChanges and the
sandbox suite's base entry name are module-private again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…date>"

The Releases screen says "release", never "version": the server-written
fallback note follows ("Reapply: release from <date>", "Reapply: earlier
release").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…, and when

GET /api/:org/decofile/:project/:branch/changed-by?block=<key> (1 to 5 keys,
signed-in members only) answers { changedBy: { [key]: { name?, email?,
avatarUrl?, at, you? } } } for the "someone else changed this" dialog. The
editor asks once per version the dialog shows, never per poll.

- Fast Preview (v7): nothing new is stored. The block file's latest commit on
  the draft branch (insights listCommits with a new `path` filter, limit 1:
  one GitHub call per block) gives the Co-authored-by trailer the coalescer
  appends, else the commit author when it is a person, and the commit time.
- v8 hosted drafts are not git: each draft save now records, per draft name,
  the Studio user and time in the org KV record next to the draft slug
  (never in the draft object, which anyone with its URL can read). Discarded
  or published names drop their record. A block the draft doesn't hold falls
  back to main's history, like v7.
- The identity is mapped to the org member (name, avatar) by user id or
  email, else the git name; `you` when it is the viewer. Unknown parts are
  left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
…d times only

PO: "write on the public draft, no worries. write the user_id and grab user
data on the front maybe". Each hosted draft save writes, per name it
changed, { userId, at } to sites/<site>/drafts/<slug>.edits.json, next to
the draft, instead of the org KV. The draft object itself stays exactly
{ set, delete }: every released @decocms/blocks 8 refuses a draft with any
other field (parseDraftChanges: "unexpected field"), and the SDK never
reads the sibling, so the ids can't reach a rendered page. Publish removes
both objects; the KV record is the slug again.

The session GET answers `edits` with `?edits=1`: every name the draft holds,
{ userId, at } or null when not recorded; the editor resolves the people
from the org's members. changed-by no longer reads the draft: on a v8
project it answers main's history for the keys asked (the editor asks only
for names the draft doesn't hold).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
…`); no sidecar

PO: "just add, on the block a metadata … something that tells last edited
by. but on the same json" and "do not create an edits.json please".

- Removed: the draft's `<slug>.edits.json` sidecar (written, read, deleted
  on publish), DraftStore.edits / stampDraftEdits / heldDraftEdits, the
  session GET's `?edits=1`, and the ref's `editor`. The draft is the one
  object a save writes, `{ set, delete }`, and publish copies its blocks to
  main as they are, `__meta` included (blocks drops it when resolving).
- @decocms/shared: BLOCK_META_KEY (`__meta`: { lastEditedBy: <Studio user
  id>, lastEditedAt: <ISO 8601> }), blockMetaOf, stampBlockMeta (the editor
  stamps every saved block). It isn't content: canonicalBlockJson (so
  decoBlockFingerprint, Fast Preview's `expect`) ignores it, and
  mergeBlockJson keeps the preferred side's record without a conflict.
- Hosted draft storage: a put of main's content with a new `__meta` is
  still main's content (no draft entry).
- changed-by stays the fallback for blocks without `__meta` (git history:
  the draft branch on Fast Preview, main on v8).

Tests: shared fingerprint/merge (ignored, stamped, dropped without a user,
no conflict), draft-content-storage "a save writes only the draft object"
(one object, one put, `__meta` kept in it; main's content restamped is no
change); draft-store.test.ts (the sidecar's) removed, publish logs back to
one delete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
This reverts commits d3df85b, 92038d9 and e3544e9. PO (final): "only
have metadata and changed by on v8 hosted". Fast Preview (v7) and Localhost
show no "changed by" line, so the changed-by route, the commit trailer and
author parsing, insights' `path` filter, block `__meta` (shared helpers,
canonical-JSON ignore, merge rule) and the draft's edits record all go; the
next commit keeps who and when in the hosted draft object's metadata.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
…ject metadata

PO: "only have metadata and changed by on v8 hosted". Each draft save writes
`x-amz-meta-deco-edited` on the draft object (S3 metadata, which R2 keeps):
`<name>,<userId>,<base-36 seconds>` entries joined by `;`, name and id
URI-escaped (ASCII), oldest first, capped at 1900 bytes under the 2 KB of
user metadata an object may carry, dropping the oldest entries first. The
JSON stays exactly { set, delete }; no block carries anything.

- DeliveryStore.putJson takes metadata; get returns it.
- DraftStore: load decodes the editors from the GET it already makes, and
  update stamps the names a save changed with the ref's editor (the session
  user), keeps the others, drops names no longer in the draft, and writes
  them with the draft: no extra HEAD per save.
- The session GET answers `changedBy: { [name]: { userId, at } }` next to the
  draft pointer, read from the same GET.

Tests: draft-editors (encode/decode with any characters, malformed values,
the cap dropping the oldest, stamping), draft-store (carried forward across
saves, one object, JSON free of ids, one put per save, discard and publish).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
…okens

The site editor on the Blocks v8 content protocol (hosted drafts, deco
serve, sandboxes), hosted Publish and Releases, site tokens, and the v8
parts of the section-form conflict handling: the ifMatch guard on every
v8 section save, and on hosted v8 drafts the conflict dialog names who
made the other change and when ("Ana changed the title…", their avatar,
"saved 3 minutes ago"), read from the draft object's metadata.

Rebased on main after #8027 (concurrent saves and the conflict dialog for
v7) merged as fbb64f0. This branch carried the same dialog/save changes
as cherry-picks (F4-F15); main's version of that shared code is kept
as is, and only the v8 additions sit on top of it. The web side was
squashed (replaying each cherry-pick on top of its own squash was
impractical); it replaces these commits (e2e changes in the next commit):

- feat(web): Blocks v8 site editor, hosted Publish, Releases and site tokens (ee9dc4b)
- test(web): a six-level self-referencing menu renders and edits every level (A9) (d04ba3d)
- fix(web): v8 section saves refuse to overwrite a block someone else changed (5bcaf7f)
- fix(web): opening Settings with no CMS block no longer creates CMS.json (45c2f9c)
- fix(web): "." on a page opens that page, not the catch-all template's (d9faba6)
- fix(web): a skipped preview transition no longer logs an uncaught AbortError (8e30608)
- fix(web): a section form saves one change at a time, so a refused save can't drop the next edit (0462d9b)
- fix(web): a deep link to Releases waits for main's schema instead of bouncing to Settings (38fa751)
- fix(web): a merge never swaps a field under the user's cursor (8d785f4)
- fix(web): what a user types after "The latest version was kept" is saved (6ce2aa9)
- fix(web): typing the same text again after "The latest version was kept" saves it (b3a6d74)
- feat(web): a same-field edit conflict asks the user whose version to keep (6736660)
- feat(web): the same-field conflict dialog says who made the other change, and when (843b212)
- feat(web): a hosted v8 draft's who-changed-what comes from the draft, people from the org (c4af50c)
- feat(web): every save stamps the block's `__meta`; the dialog reads it first (4cd6626)
- Revert the web's who/when from git history, draft edits and block __meta (3c8bcd2)
- feat(web): the same-field dialog says who and when on hosted v8 drafts only (3cb4269)
- fix(web): the conflict dialog reads rich text with the DOM parser, never regex sanitizing (4400428)
- feat(web): the same-field dialog must be answered, with yours preselected (2e9e5e3)
- fix(web): a skipped page-to-page preview transition no longer logs an uncaught AbortError (8cdb102)
- fix(web): the open conflict dialog follows their version in place (f27634b)
- fix(web): a Fast Preview frame loads one draft at a time (ee7cf18)
- fix(web): the merge toast says both changes were kept (580f814)
- feat(web): the same-field dialog shows two people, two cards (d6675e1)
- chore(web): applyLabel is not exported (43b28fd)
- feat(web): several conflicting fields are asked one at a time (e533e43)
- feat(web): the conflict dialog's buttons read Next and OK (6f9ab40)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
…lish and Releases

The e2e side of the previous commit: the content protocol over GitHub,
deco serve and its stub, hosted drafts, Publish, Releases and changes.*,
and the v8 cases of the stale-form and same-field dialog specs (who made
the other change on hosted v8). Squashed with the web side; it replaces
these commits plus the e2e parts of the web commits listed there:

- test(e2e): Blocks v8 content protocol, drafts, Publish, Releases and changes.* (463f8cc)
- test(e2e): the deco serve spec follows the UI and its stub, on a production build (9ae3629)
- test(e2e): the CMS settings guard test holds the editor's polls (f54b9bc)
- test(e2e): stale-form toasts are counted as they appear (e725bdb)
- test(e2e): same-field conflicts go through the choose-versions dialog (6ec2500)
- test(e2e): find the form behind the conflict dialog with includeHidden (024b6f3)
- test(e2e): the hosted session read answers changedBy next to the draft pointer (b5d7979)
- test(e2e): the GitHub conformance run opens one socket per request (695fca3)
- test(e2e): the open conflict dialog shows a newer version of theirs with no click (1f2d72f)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
api, web and e2e move from 8.2.1 to 8.4.0 (published, latest). Studio
imports only /protocol, /protocol/server, /protocol/storage/fs,
/protocol/keys, /protocol/conformance and /secrets; none of them changed
between 8.2.1 and 8.4.0 (8.3.0/8.4.0 add /image, /preview and /vite, the
NODE_ENV dev default, schema --check and multivariate first-match, and an
optional vite peer), so no code changes. bun.lock gains only the
@decocms/blocks entries. The legacy-secret-guard test no longer points
at a patch that was dropped long ago.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
try {
return await daemon(claim, path, init);
} catch (error) {
return new Response(JSON.stringify({ error: String(error) }), {
@tlgimenes
tlgimenes marked this pull request as ready for review October 19, 2026 19:29
@tlgimenes
tlgimenes merged commit 25e8262 into main Oct 19, 2026
32 of 33 checks passed
@tlgimenes
tlgimenes deleted the feat/blocks-v8-hosted branch October 19, 2026 19:30
decocms Bot pushed a commit that referenced this pull request Oct 19, 2026
PR: #8062 feat: Blocks v8 in Studio — content protocol, deco serve, hosted publish and releases, site tokens
Bump type: minor

- decocms (apps/api/package.json): 4.500.8 -> 4.501.0
- @decocms/e2e (packages/e2e/package.json): 1.119.1 -> 1.120.0
- @decocms/shared (packages/shared/package.json): 0.169.0 -> 0.170.0
- @decocms/ui (packages/ui/package.json): 1.23.1 -> 1.24.0

Deploy-Scope: both
tlgimenes added a commit that referenced this pull request Nov 10, 2026
…ases (#8425)

Sites published under the first v8 format (#8062) still keep flat
`revisions/<commit-sha>.json` files next to the new revision folders.
S3/R2 MaxKeys counts those files together with the CommonPrefixes, and
the plain hex SHAs sort before the inverted-timestamp ids, so the
Releases tab returned empty pages until "Load more" got past them
(osklenbr-faststore-studio: 2 empty pages before the 19 releases).

The first page now LISTs with StartAfter = the revision-id floor of a
day from now. Every id minted so far sorts above it, and almost every
SHA sorts below it, so the old files are never paged through.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants