Skip to content

feat(site-editor): v8 is per site — no org flag; on when the site runs the v8 runtime - #7878

Closed
tlgimenes wants to merge 63 commits into
split/50-site-id-copyfrom
split/51-v8-per-site
Closed

tlgimenes wants to merge 63 commits into
split/50-site-id-copyfrom
split/51-v8-per-site

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7876 (split/50-site-id-copy). Part of the v8 stack in #7796.

PO decisions

"we should not gate v8 like this [the site_editor_content_protocol org flag]. v8 is per site and enabled as soon as the website is running the v8 runtime. v8 runtime is detected by checking v8 markers on the schema."

"make sure v8 detection is homogeneous across the codebase. Always detect v8 by reading schema's version content, right?"

2026-10-12, the decision model this PR implements:

"The site-editor ui always waits for a schema and content. Having those, the ui can read the schema and decide if either v8 or not. When not using sandbox nor localhost, the schema should be fetched from main. If v8, content comes from main + cdn, otherwise content comes from branch. If using sandbox or localhost, content comes from the server's surrounding context, like either deco serve or the go sandbox."

2026-10-13, two routes this PR (and the stack under it) used to add are gone:

"/api/:org/blocks-major/:projectId should not exist. Why don't we just read the schema on the front? We need the schema anyways on the front for making the json schema form."

"/api/:org/sandbox/:projectId/:branch/assets/:name should not exist. Uploading directly to the fs should be done only on /site-editor play mode. Hosted mode (with a project etc) should use our s3 service, and sandbox has nothing to do with it."

See Routes below for the full list after this change.

Also decided on 2026-10-12:

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

Every v8 decision in Studio, on the server and in the web app, comes from one predicate on the schema's content: isV8Schema in @decocms/shared/blocks-major (a top-level "blocksMajor": 8 in .deco/schema.gen.json). The org flag no longer exists.

Decision model

The editor shows a loading state until it has both a schema and the content for its mode, then reads the schema. It never renders the v7 path first and switches later.

Mode When Schema read from v8 (isV8Schema) not v8
Localhost a deco serve connection is chosen (or the account-less /site-editor) the deco serve content protocol on the deco serve the guided "not v8" state (no schema yet: the schemaless guide)
Sandbox the session has a sandbox (a coding session) the Go daemon's working tree content protocol on the daemon the existing v7 sandbox path (an older daemon without the protocol reads as v7)
GitHub otherwise main: schema.get on the project's existing /decofile/:id/:branch/rpc, decided on the front with isV8Schema (the server answers a v7 main schema: null from its cached per-head/blob answer) main + CDN draft (the hosted CMS) through Studio's GitHub backend content from the branch: the v7 path, exactly as on main
  • selectContentBackend (content-backend.ts) is the pure table above. Every answer that isn't known yet is pending.
  • A schema that can't be read is v7 unless the site was last found v8. The PO's rule for this PR is "make sure current v7 flows continue working just fine", so a site whose schema can't be confirmed v8 behaves exactly like main:
    • GitHub mode: when main's schema.get fails (GitHub down, revoked token), main's answer is error (the editor waits with "Trying again" and keeps retrying) only on a project whose metadata.blocksMajor marker says the server last found it v8. Any other project reads v7 and gets the v7 editor, preview and Local tunnel at once, as on main. The read keeps polling, so a later v8 answer still takes over.
    • Sandbox mode: a daemon that fails (anything but 404) before it ever answered waits only on a marked project; any other project gets the v7 sandbox editor, as on main. A later v8 answer from the daemon still takes over.
    • Server: the decofile GET/publish treat a failed read of main as v7 unless the editor said it acts on v8 (x-deco-main-schema: v8) or, with no header, the project is marked v8.
    • A failed read's answer holds while it is re-polled (readFailed), so the editor never flips between its fallback and the loader every 5 s.
  • useMainSchemaV8 (hooks/use-main-schema-v8.ts) is how the web app knows main's answer: one schema.get per project per session on POST /api/:org/decofile/:id/main/rpc (the endpoint the v8 form reads its schema from anyway; describe/schema.get always read main, whatever the branch), then isV8Schema on the front. Mounted when a project opens and shared by every surface. No route of its own. The rpc route answers any site:
    • v7 main, asked without x-deco-main-schema: v8 (the editor's open): a read-only storage with no schema (schema: null), from projectMainIsV8 alone (a fresh ETag'd head read, a 304 on an unchanged main, and the per-commit answer; no other GitHub call). Fresh like the removed route, so a push to main and the marker are picked up at once on open; gated calls from an open editor keep reusing the last minute's answer. An editor that says it acts on v8 still gets 409 main_schema_changed.
    • Gates only a v8 main reaches settle it as v8 without a schema: 409 site_not_owned, 503 hosted_delivery_unconfigured (newly coded).
    • 404 no_repository (newly coded) and 403 feature_not_in_plan settle it as v7. Anything else (an unreadable main, 5xx) is an error that is retried, never a v7 answer.
  • The marker is a hint, never a v8 answer. metadata.blocksMajor is the server's cached answer for main. The client uses it for one thing only: whether an unreadable schema waits (last found v8) or is v7. Nothing becomes v8 because of it; a test asserts this for every mode. The Localhost item, Versions tab, Site tokens, the v7 Local tunnel and the hosted draft session all read useMainSchemaV8.
  • Localhost item: in the draft list for projects whose main schema is v8 (known after the wait). v7 keeps main's Advanced → Local. A stored Localhost choice waits for main's answer (undecided) instead of picking another backend first. Once connected, the deco serve's own schema decides: a non-v8 deco serve on a v8 project shows the existing "not v8" guide.
  • Hosted draft session (nothing boots; the published site is the preview) only in GitHub mode on a v8 main. A sandbox session on a v8 site boots as usual.
  • Server gates compute, never trust the marker. projectMainIsV8 (hosted/blocks-major.ts:142) runs isV8Schema on main for the decofile GET/publish/rpc (decofile.ts:293), the hosted routes middleware (hosted.ts:111) and the sandbox-less git routes (draft-publish-status.ts:93). A missing marker (repo seeded after create) or a stale one (main back on v7) gets main's real answer, written through. A gate reuses its last minute's answer only while it agrees with the marker, so an open on any pod (which writes the marker) is picked up at once.

Cost on v7 (the only added cost is main's schema read, made cheap):

  • The editor: one schema.get on main's rpc per project per session. On the server that is projectMainIsV8, read fresh: an ETag'd head read (a 304 on an unchanged main) and a per-commit answer; the schema is downloaded only when its blob changes, and a v7 answer carries no schema body. No probe and no other protocol call on a v7 main.
  • Server gates on a v7 site: at most one head read per repository per minute (the rest reuse the answer). The route tests assert one schema read across GET/PATCH/status/publish/rpc.
  • A sandbox session also asks its daemon for the working tree's schema (the PO's rule: the sandbox decides). An older daemon answers 404, read as v7 at once.

What changed

One detector, packages/shared/src/blocks-major.ts (isomorphic):

  • isV8Schema(schema): a plain object (not an array) whose blocksMajor === 8. Anything else is v7: a missing field, "8", 9, null, a nested field, unparseable text, or no file.

  • isV8SchemaText(text) and schemaGenPath(packagePath). The file is always <packagePath>/.deco/schema.gen.json, which is what deco schema writes and what deco content hashes. meta.gen.json no longer counts.

  • isBlocksV8Project(metadata) and BLOCKS_MAJOR_METADATA_KEY, moved here from thread/session-runtime. They read the server's cached answer (see below); the web app never calls them to decide.

  • A guard test (blocks-major.test.ts) scans every .ts/.tsx/.js/.mjs/.cjs file under apps/ and packages/, with comments stripped. It fails on:

    • any use of the blocksMajor token in source outside this module. Only two places are allowed: the VmcpRuntimeMetadata.blocksMajor type field, and the en/pt-BR copy telling a developer to add "blocksMajor": 8.
    • a test or fixture that does anything but write blocksMajor: <value>.
    • any other definition of the predicate or its constants.
    • a function with v8 in its name that isn't on a short allowlist of functions built on the predicate.
    • the old heuristics: a version or major compared with 8, ["@decocms/blocks"] lookups, describe.version/describe.protocol, meta.gen.json in a deciding file or on a line next to v8.
    • the old flag name anywhere.
    • new: any use of the marker (isBlocksV8Project, BLOCKS_MAJOR_METADATA_KEY) in apps/web outside use-main-schema-v8.ts. There, useMainSchemaV8 compares the server's fresh answer with the project it holds to re-read it, and useLastFoundV8 gives the sandbox decision its hint for a failed read.

    It also has its own tests showing it catches m?.["blocksMajor"], { blocksMajor: m } = s, "blocksMajor" in s and Reflect.get(s, "blocksMajor").

The marker is the server's cache of main's answer. metadata.blocksMajor stores isV8Schema on main's schema. Only code that has just run the predicate writes it, through syncBlocksMajorMarker, in every org; it is cleared when main goes back to v7. Writers: create/import (background), thread create (bounded, only when the answer decides the runtime stamp), every hosted gate (projectMainIsV8), which includes the editor's read of main's schema on open, and the admin backfill. No client-triggered refresh route.

mainIsV8 is cheap. It reads main's head (ETag-cached, so an unchanged head costs a 304) and remembers the answer per (repo, site folder, head commit) and per schema blob, both immutable keys in bounded LRUs. With recentIf (the gates), the last minute's answer per (repo, branch, folder) is reused without the head read while it equals the marker.

A v8 project that doesn't own its site gets guidance, not an error. Examples: a second project on the same repository, or an import whose site another project or org already claimed. /rpc, the decofile GET/publish and the hosted routes answer 409 {code: "site_not_owned"}, kept apart from an unconfigured bucket (503). The editor's read of main's schema reads that 409 as v8. The editor's GitHub probe reads the 409 as a guided state and does not retry it. Blocks and Content then say "This site is edited from another project", with a link to the projects list (en, pt-BR).

Removed: the flag from OrgFlagsSchema (tool-io.ts regenerated), the flag gate in decofile.ts (contentProtocolEnabled), and the flag checks in hosted.ts, draft-publish-status.ts, blocks-major.ts and admin.ts. On the web side: the useOrgFlagState gates, hostedCmsAvailable, releasesPending, useBlocksMajorRefresh, useSessionRuntime().isBlocksV8 and every client read of the marker.

Ownership still applies. Hosted writes still need the project to own its site in org_sites (ownedProjectSite). That is an identity check, not a feature gate.

Every v8 detection site: before → after

Before (origin/split/50 @ 499b498):

file:line detector
packages/shared/src/organization/schema.ts:286 org flag site_editor_content_protocol
apps/api/src/api/routes/decofile.ts:261-280, 292, 676 org flag (GET, publish, rpc)
apps/api/src/api/routes/decofile.ts:394-399, 564-568 "a CDN draft exists" counts as v8
apps/api/src/api/routes/hosted.ts:82-87 org flag (Releases, site tokens)
apps/api/src/hosted/draft-publish-status.ts:77-82, 95-111 org flag, and "a draft exists" counts as v8
apps/api/src/hosted/blocks-major.ts:92-95 org flag plus owned site, before the marker is written
apps/api/src/api/routes/admin.ts:1063-1073 org flag, before the backfill writes the marker
apps/api/src/hosted/scope.ts:51 mainIsV8 its own copy: schema.gen.json, via schemaHashOfText !== null
apps/api/src/hosted/release-objects.ts:56-73 schemaHashOfText its own copy, checks blocksMajor !== 8 inline
apps/api/src/decofile/repo-content-storage.ts:50 isV8SchemaText its own copy, falls back to meta.gen.json
apps/web/.../content-backend.ts:134 isV8Schema its own copy, which accepts arrays
apps/web/.../use-content-backend.ts:146 org flag
apps/web/.../use-content-backend.ts:153 route presence: /site-editor counts as v8
apps/web/.../content-backend.ts:192 connection presence: a deco serve counts as v8 whatever its schema
apps/web/.../content-backend.ts:82 hostedCmsAvailable org flag (Versions, Site tokens)
apps/web/.../use-project-native-view-presence.ts:42 org flag (Versions tab)
apps/web/src/views/virtual-mcp/index.tsx:888 org flag (Site tokens)
apps/web/.../content-version-badge.tsx:24 any protocol backend shows "v8"

After (this PR @ b94f0af). There is one predicate. Every row below applies it:

file:line what it does
packages/shared/src/blocks-major.ts isV8Schema / isV8SchemaText, the only detector; isBlocksV8Project reads the server's cached answer
apps/api/src/hosted/scope.ts:110 mainIsV8 the predicate on main's schema.gen.json (per-commit, per-blob and recentIf caches)
apps/api/src/hosted/release-objects.ts:53 the predicate at a commit, before hashing
apps/api/src/decofile/repo-content-storage.ts:149 the predicate on the schema the GitHub backend serves
apps/api/src/hosted/blocks-major.ts:85 readMainBlocksMajor fresh mainIsV8 + marker sync, for create and thread create (module-private)
apps/api/src/hosted/blocks-major.ts:142 projectMainIsV8 the hosted gates: mainIsV8 (recentIf the marker) + write-through
apps/api/src/api/routes/decofile.ts:293, 318, 687 scopeIsV8 / unownedV8 / rpc gate, all projectMainIsV8
apps/api/src/api/routes/hosted.ts:111 middleware: projectMainIsV8; site-token issue re-reads fresh
apps/api/src/hosted/draft-publish-status.ts:93 projectMainIsV8, after the cheap ownership/bucket checks
apps/api/src/tools/thread/create.ts, tools/virtual/create.ts, routes/admin.ts thread stamp, create/import, backfill: mainIsV8
apps/web/src/hooks/use-main-schema-v8.ts isV8Schema on main's schema (rpc schema.get), once per project per session
apps/web/.../content-backend.ts:141, 176, 229, 91 contentMode, selectContentBackend, contentProbesEnabled, hostedDraftSession: the table above
apps/web/.../use-content-backend.ts the predicate on the schema of every probed backend (GitHub, sandbox daemon, deco serve); localServeBackend gives a non-v8 deco serve the guided not-v8 state
apps/web/.../content-version-badge.tsx the badge shows only for a schema that passed
use-deco-serve-connection.ts, use-local-preview-url.ts, use-project-native-view-presence.ts, views/virtual-mcp/index.tsx, chat-mode-row.tsx, preview.tsx main's answer (useMainSchemaV8)
packages/shared/src/thread/session-runtime.ts:67 the server's cached answer, for a new thread's default runtime only

The Go daemon only serves the schema file and makes no decision. I found no detector based on package.json, the manifest shape, describe fields or the @decocms/blocks version.

Risks

  • Hosted writes for any org's owned v8 site: drafts, revisions, latest.json, purges and site tokens. (Staging and prod sharing the key and bucket is intended, per the PO.)
  • Every v8 site gets these on the client: Fast Preview by default, Localhost, Versions, Site tokens, hosted drafts and the v8 badge. A v8 site that doesn't read the delivery CDN shows "Published" while nothing is live (plan §B-11).
  • The editor waits on main's read in GitHub mode, v7 included. It is one cached request per project per session, started when the project opens, so it has usually landed before the editor mounts (on the real v7 site below: no visible difference). If GitHub can't be read, a v7 site gets the v7 editor as on main; only a site last found v8 waits with "Trying again".
  • An unmarked v8 site whose schema can't be read (GitHub down on its very first open, or a daemon failing before it answers on a branch that turned v8) shows the v7 editor until the read succeeds, then switches. This is the price of never holding a v7 site behind an outage; any v8 site opened once is marked and waits instead.
  • A v8 site with a stale v7 Local tunnel shows the tunnel until main's answer lands (a v7 site never boots a sandbox it didn't on main, so the tunnel isn't held back).
  • The admin backfill writes the marker in every org.
  • An org that still has the flag stored keeps working. Reads are lenient and the key is inert; the admin editor lists it as a custom flag.

v7 regression check

PO: "make sure current v7 flows continue working just fine after changes". v7 = a site whose main .deco/schema.gen.json lacks "blocksMajor": 8. Baseline: origin/main 21912be (this stack's merge-base).

Test suites, test by test (origin/main CI vs this branch)

Suite origin/main this branch passes on main, fails/skipped/gone here
Unit (bun test, per-file isolation) 10551 pass, 0 fail, 1014 files 11014 pass, 0 fail, 1062 files none (5 names in secret-field.test.ts renamed, see below)
Web component tests 252 passed 252 passed none, same list
E2E (2 shards) 383 passed, 10 skipped 408 passed, 10 skipped none, the same 10 voice/decopilot skips
Sandbox daemon e2e 225 pass, 1 skip 304 pass, 1 skip none, the same voice skip
  • No test file deleted. 22 changed; the only v7-relevant expectation change is secret-field.test.ts (SecretField → SecretFieldForBackend), which renders the old SecretField unchanged on a legacy backend; ct/tests/secret-field.ct.tsx still covers v7 with the backend stubbed to legacy. The rest add tests only, or keep v7 behaviour (admin-project-metadata, fast-preview fixture still defaults on, github-stub real blob ids/GraphQL, playwright.config hosted env vars).
  • main CI runs: test, e2e, sandbox.

A real Blocks 7 site, nine flows, origin/main Studio vs this branch

Site: deco-sites/storefront-tanstack main (@decocms 7.77.1), its real .deco/blocks, meta.gen.json and no schema.gen.json, on a local GitHub stub that opens and merges PRs and can go unreachable on demand. A fresh project on each Studio; same two test-only shims on both (frame-ancestors, loopback draft host).

Flow origin/main this branch difference
1. Open editor (forms + preview) ok; preview loads the draft link same one extra POST /decofile/:id/main/rpc schema.get (200, schema: null) — measured with the earlier /blocks-major read, same cost
2. Edit a field on Production commits to main; preview 2.2 s commits to main; 1.7 s none
3. New draft + edit draft branch, edit committed there, "Review & Publish" same none
4. Switch drafts Draft 2 shows main; Draft 1 its edit (~0.5 s) same none
5. Publish commit, PR, merge into main (~0.9 s) same toast copy only (below)
6. Advanced → Local Branches / PRs / Local; reads /.decofile and /live/_meta from the local URL same none
7. Fast Preview switch off/on saves false then true same none visible (below)
8. Releases / Versions / Site tokens absent; hosted routes 404 same /rpc 409 instead of 404 (below)
9. GitHub unreachable 50–75 s "Blocks unavailable … Retry"; Retry recovers in 0.94 s identical, no "Trying again" main's schema.get re-polled every 5 s (network only)

v7 regressions found and fixed in this PR

  1. Unreadable main held every project (d422522). Main's read failing (then POST /blocks-major, now schema.get) made v7 projects wait with "Trying again" forever and held the preview, live meta, decofile and Local tunnel; on main a v7 site never waited on GitHub. Now v7 unless marked v8 (above). Also fixed: each 5 s retry put the editor back to loading, reloading the preview. Tests: use-main-schema-v8.test.ts; e2e "a v7 site whose main can't be read still gets the v7 editor, as on main" (content-protocol-github.spec.ts).
  2. Coding session with a failing daemon (ae2af4d, 6082b95). A daemon failing (not 404) before it ever answered made a v7 coding session wait forever; main showed the v7 sandbox editor. Now the v7 sandbox editor unless marked v8; the failure holds through re-polls. Tests: content-backend.test.ts (decision table rows, the unmarked sequence, "the marker never makes a project v8 on its own", readFailed).
  3. Publish without the main-answer header on an unreadable main (ae2af4d). POST /decofile/:id/:branch/publish (and GET) on a linked v7 project answered 502 where main went on to merge. Now v7 unless the request said v8 or the project is marked v8. Tests: v8-gates.test.ts "main unreadable on a site the project owns".

Remaining v7-visible differences, each intended

  • Publish toast copy: one toast, "Published · Your changes are live on …", instead of "Published to …" plus two "Item updated successfully" (ea39a2f, the one-toast-per-action rule).
  • /rpc exists on a v7 project (main had no route): it answers schema.get with schema: null (read only), and 409 main_schema_changed to an editor acting on v8. It is re-polled every 5 s while GitHub is unreachable. Requests only; nothing on screen changes.
  • Coding session while the sandbox clones: this branch reads nothing until the working tree is there; main also read the live site's /live/_meta and tried the sandbox's decofile read, which 502s until the clone lands and is only re-driven at that moment (sandbox-events-context.tsx). Both show loading until then, so the editor is usable at the same point.

Routes (whole stack, after 2026-10-13)

New

  • POST /api/:org/decofile/:projectId/:branch/rpc: the content protocol over main + the CDN draft (v8). Answers main's schema for any site: a v7 main gets a read-only schema: null (no other read). This is how the editor reads main's schema.
  • GET /api/:org/hosted/:projectId/releases, POST /api/:org/hosted/:projectId/releases/current: Versions (v8 hosted).
  • GET|POST /api/:org/hosted/:projectId/site-tokens: site tokens (v8 hosted).
  • POST /api/:org/sandbox/:projectId/:branch/rpc: proxy to the daemon's content protocol (sandbox sessions).
  • POST /api/_admin/hosted/site-claims/backfill: admin backfill (site links + v8 marker).
  • Daemon (feat(daemon): content protocol in the sandbox daemon #7877): /_sandbox/rpc, one route.

Changed

  • GET /api/:org/decofile/:projectId/:branch and POST …/publish: 409 main_schema_changed when the editor's x-deco-main-schema answer is out of date, 409 site_not_owned for an unowned v8 site, and a v8 project's ?__draft= pointer instead of the decofile.
  • Every /api/:org/decofile/… route: the "no repository" 404 now carries code: "no_repository"; rpc's 503 carries code: "hosted_delivery_unconfigured".
  • GET /api/:org/sandbox/:projectId/:branch/git/status and POST …/git/diff (sandbox-less): a v8 project's hosted draft status and diff.

Removed (were in this stack, never on main)

Asset uploads, by mode (no new route; the existing S3 service)

Mode Uploads go to
v8 hosted (GitHub) and v8 sandbox Studio's S3 asset service: POST /api/:org/file-configs/:id/upload (on main), the managed deco-assets-<site> config, assets.decocms.com/<site>/…
v7, any mode same, unchanged
Localhost and /site-editor play mode the connected deco serve: PUT <deco serve>/assets/<name> into its working tree, unchanged

The field decides with a pure serveAssetUploadOrigin (only a connected deco serve that takes uploads; a sandbox or hosted project never uploads to a filesystem, whatever its describe says). So the S3 path works for sites created in Studio too, project create now gives a linked site its managed config (the helper the deco.cx import already used, moved to file-storage/managed-site-config.ts); before, only imported sites had one and others opened the bucket picker.

Test evidence

  • packages/shared/src/blocks-major.test.ts: the predicate on every shape; the guard (one detector, no other blocksMajor reader, known v8 functions only, no old heuristics, no flag) and, new, no web use of the marker outside useMainSchemaV8.
  • apps/web/.../content-backend.test.ts (rewritten): the decision table, each mode × v8/v7 × loading/error (GitHub on main's answer, Sandbox on the daemon's, Localhost on the deco serve's, a stored Localhost choice waiting for main); Sandbox mode never reads main; an unreadable schema is v7 unless the project is marked v8, and the marker never makes a project v8; no v7 flash: every order in which reads land goes from pending to one final editor, never from one editor to the other; probes (the GitHub backend only for a v8 main, the daemon in Sandbox mode); hostedDraftSession only in GitHub mode on a v8 main.
  • apps/web/src/hooks/use-main-schema-v8.test.ts (new): the server's answer; no repository is v7; an unreadable main (502) waits (error) only on a project marked v8 and is v7 on any other; loading until it lands; the answer survives a failed refetch and holds through re-polls.
  • use-deco-serve-connection.test.tsx, use-local-preview-url.test.tsx: driven by main's answer, never the marker; a stored Localhost choice is undecided while main loads; the v7 tunnel stays in use while main loads or errors (no sandbox boot a v7 site didn't have on main).
  • use-content-backend.test.ts: the GitHub/sandbox/deco serve probes on the new inputs.
  • apps/api/src/api/routes/v8-gates.test.ts (real routes, in-memory storage, a recording fake repo):
    • Main's schema over rpc (new, replaces the /blocks-major tests): a v7 site answers schema: null, read only, from one cached read (a repeat open reads only the head); never takes a write; a v8 main writes the marker and answers 503 hosted_delivery_unconfigured without a bucket; unowned v8 → 409 site_not_owned; a stale marker is cleared; no repository → 404 no_repository with no read; an unreadable main is an error, never v7, and writes nothing.
    • Hosted middleware: a v7 main is 404 with one schema read for all four routes and no org_sites read; new an unmarked v8 project is served and marked; a stale v8 marker over a v7 main is 404 and cleared; new the last minute's answer is reused while the marker agrees and re-read once another pod's open writes a different one; site-token issue re-reads main fresh.
    • Decofile: a v7 project reads main's schema once across GET/PATCH/status/publish/rpc and writes nothing (rpc with the v8 header → 409 main_schema_changed); new an unmarked v8 project has the protocol; unowned v8 gets site_not_owned.
  • draft-publish-status.test.ts: main decides, not the marker (an unmarked v8 main gets its draft and the marker); v7: null; a repeat v7 read within the minute makes no repository call; unowned: no GitHub read.
  • e2e content-protocol-github.spec.ts: the v7 editor test asserts the page read main's schema (schema.get on main's rpc, 200) and made no other protocol call; the unreadable-main test fails that read; refreshV8 (what opening does) is now schema.get + isV8Schema. content-protocol-deco-serve.spec.ts opens its project the same way.
  • use-main-schema-v8.test.ts: decides v8 from the schema it fetched (isV8Schema, v7 null, blocksMajor: 9), the gates that settle it (no_repository, feature_not_in_plan → v7; site_not_owned, hosted_delivery_unconfigured → v8), errors that are retried, and the request (main's rpc, schema.get, no main-schema header, uncached).
  • content-backend.test.ts serveAssetUploadOrigin: Localhost and /site-editor (a connected deco serve) upload to it; hosted and sandbox projects go to Studio's file storage, even when a describe advertises an upload folder.
  • managed-site-config.test.ts: the managed (S3) config is created for a linked site, left alone when it exists, a legacy one upgraded.
  • Local runs @ b94f0af: tsc --noEmit clean for apps/api, apps/web, packages/shared, packages/e2e; oxlint, biome and knip clean; bun test passes for packages/shared blocks-major (16), apps/api hosted + decofile + v8-gates + sandbox-proxy (149 + 18), apps/web sections-editor/preview/main-panel-tabs/pills/hooks (1676; the one use-local-app-reachable timing failure passes alone and is unchanged); the four component specs that read fields (51) pass.
  • 2026-10-13 (routes dropped), commits on this PR: a7cbf23 (front reads main's schema, /blocks-major gone), 0485e6b (managed S3 config at create), d5b8a6a (the open reads main fresh), bb3f849 + 81e0b6a (e2e). Lower in the stack: d6d03a7 (feat(daemon): content protocol in the sandbox daemon #7877, daemon upload route gone), 9e82924 (feat(api): proxy /_sandbox/rpc and report draft publish status #7825, sandbox asset proxy gone), 5bfb253 (feat(web): protocol fields: browser-encrypted secrets, asset uploads #7826, sandbox uploads → S3), each merged up normally.
    • Local @ 81e0b6a: tsc --noEmit clean for apps/api, apps/web, packages/shared, packages/e2e, packages/sandbox; oxlint, biome, knip clean; bun test: v8-gates (27), apps/api/src/hosted (110), managed-site-config (7), sandbox-proxy.content (3), blocks-major guard (16), use-main-schema-v8 (10), content-backend (56), use-content-backend (21), use-deco-serve-connection (8), use-local-preview-url (6); Go vet + test for the daemon; daemon content-protocol e2e 79 pass.
    • CI (workflow_dispatch on split/51-v8-per-site @ 81e0b6a): Checks & Unit Tests success, E2E Tests success (186 + 190 passed, 0 flaky), Sandbox success @ d5b8a6a (no sandbox change after it).
    • On the way: the first E2E round caught the v7 rpc tests still expecting 409 and the "no repository" body; the second showed the open read could be a minute stale after main went back to v7 (fixed in d5b8a6a, with a unit test). A signed-in site-editor test that fails its first attempt after 2.0 min and passes on retry also flaked before this change (/site-editor shows the org rail, run 38339765440).
  • CI (workflow_dispatch on split/51-v8-per-site @ 6082b95):
    • Checks & Unit Tests: success
    • E2E Tests: success, including the new v7 unreadable-main test
    • Sandbox: success
    • @ ae2af4d the guard test failed: use-content-backend.ts read the marker directly. Fixed in 6082b95: it reads it through useLastFoundV8 in use-main-schema-v8.ts, which the guard lists as a hint, never a v8 answer.
    • Earlier @ d422522: test, e2e, both success.
    • @ 711abfb the component tests failed: the fields' deco serve connection now reads useMainSchemaV8, which the CT harness has no provider for. Fixed in b94f0af with a CT stub (main reads as v7, as the content backend already reads as legacy there).

Stack

v8 Fast Preview track: previous: #7876 · next: none (top of the stack). Base: split/50-site-id-copy. Part of the v8 stack in #7796. Same tree as feat/blocks-v8-hosted (its latest merge of split/51 @ 81e0b6a; git diff empty).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

tlgimenes and others added 2 commits October 12, 2026 17:18
PO: "we should not gate v8 like this [the site_editor_content_protocol org
flag]. v8 is per site and enabled as soon as the website is running the v8
runtime." and "Always detect v8 by reading schema's version content".

- @decocms/shared/blocks-major: the one detector (isV8Schema,
  isV8SchemaText, schemaGenPath) plus the cached-answer reader
  (isBlocksV8Project, BLOCKS_MAJOR_METADATA_KEY), moved out of
  session-runtime. A guard test fails on any other blocksMajor read, any
  other v8 predicate, or the old flag name anywhere in apps/ or packages/.
- mainIsV8 runs the predicate on main's .deco/schema.gen.json through the
  ETag-cached head, the cached tree and a per-blob answer cache, instead of
  a /contents download + sha256 per call. release-objects and the GitHub
  content reader use the same predicate and path (no meta.gen.json).
- The org flag is gone from OrgFlagsSchema and every gate: decofile GET,
  publish and rpc, the hosted routes (Releases, site tokens), the
  sandbox-less /git routes, create/import and the admin backfill. The
  "a CDN draft exists" heuristic is gone too.
- The marker stays only as the predicate's cached answer for main, written
  in every org: awaited (3 s max) on create/import, refreshed by
  POST /api/:org/blocks-major/:id when a project is opened, and confirmed
  with mainIsV8 (written through, cleared on v7) before anything hosted.
  Unmarked projects take the v7 path at no extra cost, as on main.
- org_sites ownership (ownedProjectSite) still gates hosted writes.

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

- The content backend, Versions and Site tokens follow the project's v8
  marker (the server's cached isV8Schema answer for main) alone; the
  org-flag input, hostedCmsAvailable and the releases "pending" state are
  gone.
- No route-presence or connection-presence detector: a deco serve
  (Localhost or /site-editor) is decided by its own schema. A schema
  without "blocksMajor": 8 is a guided "not-v8" state; no schema yet keeps
  the schemaless guide. The v8 badge shows only for a schema that passed.
- isV8Schema comes from @decocms/shared/blocks-major (the web copy is gone).
- useBlocksMajorRefresh: opening a project asks the server to re-run the
  predicate on main and re-reads the project when the marker changed, so a
  repo seeded after create, or a site that upgrades later, gets the v8
  editor without a reload.
- e2e: no org flag; the deco serve stub writes "blocksMajor": 8 as
  deco schema does, and projects are marked through the refresh route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes and others added 25 commits October 12, 2026 17:57
… site_not_owned

- Thread create runs the bounded v8 check before stamping the runtime, only
  when its answer decides the stamp (repo + preview server, unmarked, Fast
  Preview off), so a v8 site seeded after create still gets a cms thread.
- Project create is back to fire-and-forget: creating a project (v7
  included) never waits on GitHub.
- mainIsV8 remembers its answer per (repo, site folder, head commit): a
  repeat open on an unchanged main is one head read, no tree read, no write.
- syncBlocksMajorMarker reports whether the stored marker matches;
  refreshBlocksMajorMarker answers null when the write failed.
- A v8 project that doesn't own its site gets 409 {code: site_not_owned}
  from /rpc, the decofile GET/publish and the hosted routes, apart from an
  unconfigured bucket (503); /blocks-major also returns hostedSite.
- Routes take an injectable repo client; route-level tests for
  /blocks-major, the hosted middleware and the decofile gates, plus
  loadHostedDraft marker cases.
- The homogeneity guard fails on any non-comment blocksMajor outside the
  allowlist (ts/tsx/js/mjs/cjs), on reads in tests, on unknown v8-named
  functions, and on the old heuristics.

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

- The GitHub probe reads Studio's 409 site_not_owned as a guided state
  (not retried): Blocks and Content say the site is edited from another
  project, with a link to the projects list (en, pt-BR).
- Such a site is not a hosted draft session.
- e2e: a v8 site seeded after create gets a cms thread right away (v7:
  sandbox); a v8 site the project doesn't own answers site_not_owned and
  shows the guided state; a main that goes back to v7 is refused
  (-32006, no commit) and then loses the protocol.
- CT harness comments no longer say the backend comes from an org flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The refresh route now also answers hostedSite, and a v8 project that
doesn't own its site gets 409 site_not_owned from the hosted routes. The
other-org copy is refreshed first, so the assertion doesn't race the
background check on create.

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

Every hosted gate (decofile GET/publish/rpc, the hosted routes middleware,
the sandbox-less git routes) now asks main's schema through
projectMainIsV8 instead of trusting metadata.blocksMajor, so a missing
marker (repo seeded after create) or a stale one (main back on v7) gets
main's real answer, written through. A gate reuses its last minute's
answer only while it agrees with the marker, so a v7 site pays at most
one head read per minute and an open on any pod (which writes the
marker) is picked up at once.

POST /blocks-major reads main fresh and answers 502 main_unreadable when
it can't, so the editor can tell "v7" from "unknown"; isV8: null still
means no repository.

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

PO decision (2026-10-12): the site editor always waits for a schema and
content, then reads the schema to decide v8 or not.

- Localhost (a deco serve chosen): schema and content from deco serve;
  its own schema decides. A stored choice waits for main's answer.
- Sandbox (a sandbox session): the daemon's working tree decides; v8 uses
  the content protocol, anything else the existing v7 sandbox path.
- GitHub (otherwise): main's schema, from the server (useMainSchemaV8,
  once per project per session). v8: main + CDN draft (hosted); not v8:
  the branch-backed v7 path, exactly as on main.

useMainSchemaV8 replaces useBlocksMajorRefresh and every client read of
metadata.blocksMajor (Localhost item, Versions tab, site tokens, the v7
Local tunnel, the hosted draft session). useSessionRuntime drops
isBlocksV8. The guard test now fails on any web use of the marker.
Decision-table tests cover each mode x v8/v7 x loading and assert no
switch between editors as reads land.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The deco serve connection now reads useMainSchemaV8, which asks the server
through useProjectContext(); the CT harness doesn't mount it, so fields
read main as v7 there, as they already read the content backend as legacy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
- GET and publish on /decofile compare the main answer the editor sends
  (x-deco-main-schema) with the server's own and answer 409
  main_schema_changed on a mismatch, instead of the hosted shape to a v7
  editor or a branch merge for a v8 Publish.
- /rpc on a main that isn't v8 answers 409 main_schema_changed (was 404):
  only an editor that read main as v8 calls it.
- The unowned-v8 check is advisory: a main that can't be read no longer
  fails a v7 decofile read or publish. /rpc and the hosted routes still
  fail closed. A v7 editor's read treats a failed main read as v7.

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

- A failed read of the schema that decides (main's, or a daemon that never
  answered) is pending with retrying, not the v8 unavailable state: no new
  editor, no v8 badge, site code still off, and a neutral "Can't reach
  GitHub, trying again" loader.
- A saved Local tunnel waits for main's answer (undecided): v7 then uses it
  as on main, v8 never shows it. The decofile/meta reads and the preview
  wait meanwhile.
- In GitHub mode the preview holds a neutral loader while main's answer
  loads or is retried (no published site with a waking pill), and no v7
  site-code path runs before the decision.
- Main changed mid-session: the editor sends the main answer it acts on;
  on the server's 409 main_schema_changed it forgets main's answer and the
  GitHub probe and decides again, showing pending first.
- Sandbox mode keeps the daemon's answer for the thread across restarts,
  hibernate and re-clones instead of going back to pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
POST /blocks-major failing (GitHub outage, revoked token, unreadable
repo) made every project wait with "Trying again" and held the preview,
live meta, decofile and the Local tunnel. On main a v7 site never waited
on GitHub: it read the running site. Now a failed read is "error" (the
v8 retrying state) only on a project the server last found v8 (its
marker); any other project reads "v7", as on main, and the read keeps
polling so a later v8 answer still takes over.

The failure answer also stays put while the read is re-polled: a re-poll
with no data put the query back to pending every 5 s, which unmounted
the editor and reloaded the preview.

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

Two v7 paths could still fail or wait where main didn't:

- Sandbox mode: a daemon that failed (anything but 404) before it ever
  answered made every project wait with "Trying again". On main a coding
  session always got the v7 sandbox editor. Now only a project the server
  last found v8 (its blocksMajor marker, a hint, never a v8 answer) waits;
  any other one gets the v7 sandbox editor, and a later v8 answer from the
  daemon still takes over. A failed probe's answer also holds through its
  re-poll (readFailed), so the fallback never flips back to the loader
  every 5 s. Sandbox mode still never reads main's answer.
- POST /decofile/:id/:branch/publish (and GET) without the main-answer
  header on a linked v7 project 502ed when main's schema couldn't be read;
  main never read it there and went on to merge. A failed read is now v7
  unless the editor said v8 or the project is marked v8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The guard keeps every web read of the blocksMajor marker in
use-main-schema-v8: the sandbox decision now gets it from there
(useLastFoundV8, registered in the guard as a hint, never a v8 answer)
instead of reading project metadata in use-content-backend.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
`POST /api/:org/blocks-major/:projectId` is gone. The editor reads main's
schema the way it reads the form schema anyway: `schema.get` on the
project's existing `/api/:org/decofile/:id/:branch/rpc`, then decides
with `isV8Schema` itself.

That route now answers any site. A v7 main (asked without the
`x-deco-main-schema: v8` header) gets a read-only storage with no schema
(`schema: null`), served from the server's cached `projectMainIsV8`
alone, so v7 still costs one cheap cached read. An editor acting on v8
still gets 409 `main_schema_changed`. Gates that only a v8 main reaches
(`site_not_owned`, and the 503 now coded `hosted_delivery_unconfigured`)
read as v8 on the front; `no_repository` and `feature_not_in_plan` as v7.

The server keeps its marker as a cache, refreshed by create, thread
create, the backfill and every gated read (the editor's open included),
with no client-triggered refresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Hosted and sandbox projects upload assets to Studio's S3 asset service
(the managed `deco-assets-<slug>` file config, `assets.decocms.com`),
which the image and file fields lock onto by site slug. Only the deco.cx
import created that config, so a v8 site created in Studio opened the
bucket picker instead. Project create now provisions it once the site is
linked in org_sites (best-effort), with the same helper the import uses
(moved to file-storage/managed-site-config.ts), so no new service.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The decofile rpc now answers any site, so a v7 main is a read-only
`describe`/`schema.get` (no schema) instead of a 409, and writes get the
protocol's ReadOnly error; an editor acting on v8 still gets 409
`main_schema_changed`. The "no repository" 404 carries its new code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Without the main-answer header, rpc is the editor reading main's schema
as a project opens. It now reads main's head fresh (an ETag'd 304 when
unchanged), as the removed /blocks-major did, so a push to main and the
server's marker are picked up at once instead of up to a minute later.
Gated calls from an editor keep reusing the last minute's answer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The save that main's own schema check refuses is made the way an open
v8 editor makes it (with the main-answer header, inside the gate's
minute). Without the header it is now a fresh read of main, which is
already v7 and answers the read-only "not v8" storage.

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

- The main-schema answer keeps main's schema and version (`MainSchemaRead`).
  The GitHub probe reuses it (`describe` only) and the first content poll
  starts from it with `ifNoneMatch`, so a v8 GitHub open downloads the
  schema once instead of three times. A test counts the full bodies.
- The site-claims backfill gives each linked (or already linked) project its
  site's managed asset config, as project create and the deco.cx import do,
  so its hosted and sandbox uploads go to Studio's S3. Best-effort: failures
  land in `assetConfigErrors`; dry runs and refused projects get none.
- Document (and pin in a test) that a no-CMS org's v8 site reads as v7.

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

The next board replaces To Do, Approved and Merged with QA, Customer
Approval and Ready for Deployment. The release that moves cards into the
new lanes must be able to roll back to one that reads them, so this
release learns the statuses first: laneRank orders them, the board draws
one while a card sits in it, and create, update and the column-rule tools
refuse them as targets.
PR: #7879 feat(task-board): read the next board's lanes without offering them
Bump type: minor

- decocms (apps/api/package.json): 4.464.1 -> 4.465.0
- @decocms/native (apps/native/package.json): 4.464.1 -> 4.465.0
- @decocms/shared (packages/shared/package.json): 0.144.1 -> 0.145.0

Deploy-Scope: both
* feat(task-board): collapse a lane to a narrow strip

Hovering a lane header shows a collapse button. A collapsed lane becomes a
strip with its icon, vertical label and card count, plus an expand button on
hover, and still takes a dropped card. The choice is kept per person in
preferences, like the lanes shown from the hidden drawer.

* fix(task-board): use a two-headed arrow for the lane collapse toggle

* fix(task-board): diagonal arrows in for collapse, out for expand
PR: #7881 feat(task-board): collapse a lane to a narrow strip
Bump type: minor

- decocms (apps/api/package.json): 4.465.0 -> 4.466.0
- @decocms/native (apps/native/package.json): 4.465.0 -> 4.466.0
- @decocms/e2e (packages/e2e/package.json): 1.102.0 -> 1.103.0

Deploy-Scope: web
tlgimenes and others added 5 commits October 13, 2026 13:27
…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
…okens

The editor side of Blocks v8, decided per site from main's schema
(isV8Schema in @decocms/shared/blocks-major); a v7 site keeps today's
editor.

- content backend selection: GitHub (the decofile rpc route), a sandbox
  session (Studio's sandbox content route) or a local deco serve, each
  speaking the Blocks content protocol through one client; the sections
  editor, Content tab and Preview switch on it.
- v8 schema shapes and a schemaless editor; protocol fields with
  browser-encrypted secrets and asset uploads (S3 in project mode, deco
  serve for Localhost and /site-editor).
- deco serve: discovery on localhost, connect links, first-run guide,
  notices, the Local draft option and the account-less /site-editor.
- hosted v8 projects: Publish and the Versions (releases) tab, site tokens
  in settings, guided states for a site another project owns; every
  message in business language, one toast per action.
- 'releases' sidebar view (shared enum and the generated tool contracts).
- the v8 detector guard now also covers the web deciders.

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

Specs drive the Blocks content protocol through the editor over GitHub
(stubbed Git Data API) and over a deco serve stand-in built from
@decocms/blocks, plus drafts, hosted Publish against a stub delivery
bucket, and the v8 gates. @decocms/blocks is allowed in e2e as the
published wire contract.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The issue rendering gives its 12k comment budget to the newest comments
and only says "[… N older comments omitted]". A run had no way to read
those, so anything that lived in an old comment, like a test account a
card points to, was out of reach.

JIRA_ISSUE_GET takes `commentsBefore`: render only the first N comments
of the thread, with the same budget. When older comments are hidden or
the oldest shown one is clipped, the rendering names the value that
reaches them, so a run can page back to the first comment and read each
one whole once (a single comment over the budget stays clipped).
decocms-release[bot] and others added 2 commits October 13, 2026 16:30
PR: #7886 feat(jira): let JIRA_ISSUE_GET page back to older comments
Bump type: minor

- decocms (apps/api/package.json): 4.468.0 -> 4.469.0
- @decocms/native (apps/native/package.json): 4.468.0 -> 4.469.0

Deploy-Scope: server
viktormarinho and others added 9 commits October 13, 2026 13:34
* feat(task-board): switch to the new default board lanes

The board becomes Backlog -> In Progress -> In Review -> QA -> Customer
Approval -> Ready for Deployment -> Post-deploy Validation -> Done for every
org. Delegating starts a card In Progress, opening a pull request moves it to
In Review where the reviewer runs, an approval moves it to QA instead of
merging, and the merge starts only from Ready for Deployment (the Ship button,
or auto_merge on arrival) and lands in Post-deploy Validation. An agent run
cannot move a card out of QA or Customer Approval, or into them.

To Do, Approved and Merged become dormant lanes, and delivery_lanes_enabled
is removed. Migration 237 moves cards and column rules to the new lanes.

* fix(task-board): count a card's first shipped move once in analytics

A card reaches Post-deploy Validation and later Done, and the completions
per day, throughput, autonomy, cost per task and tenant scorecard panels
counted both moves. They now read each card's first move into a shipped
lane.

* fix(task-board): let chats move cards; guard only the board's own runs

Every sandbox-hosted chat goes through the thread MCP endpoint, so treating
any request there as an agent run blocked a person's chat from moving a
card into QA or past it. Drop the human-gate refusal, and scope the
under-review guard to runs the board dispatched (threads carrying task-run
instructions).

* chore: drop a build cache committed by mistake
PR: #7880 feat(task-board): switch to the new default board lanes
Bump type: minor

- decocms (apps/api/package.json): 4.469.0 -> 4.470.0
- @decocms/native (apps/native/package.json): 4.469.0 -> 4.470.0
- @decocms/e2e (packages/e2e/package.json): 1.103.0 -> 1.104.0
- @decocms/sandbox (packages/sandbox/package.json): 1.86.0 -> 1.87.0
- @decocms/shared (packages/shared/package.json): 0.147.0 -> 0.148.0
- deploy/helm/sandbox-env (chart 0.20.38) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.87.0

Deploy-Scope: both
…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
…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
(cherry picked from commit 8e5996a)
… 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
@tlgimenes

Copy link
Copy Markdown
Contributor Author

This stack is now folded into two PRs on main, in order:

This description still describes the closed daemon protocol (#7877). #7887 has the current design.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

viktormarinho and others added 9 commits October 13, 2026 14:10
…ads with the decocms-studio skill (#7885)

* fix(api): keep object-storage tools out of the org filesystem

PUT_PRESIGNED_URL, DELETE_OBJECT and DELETE_OBJECTS accept any key, including
`_fs/<volume>/...`, where org filesystem bytes live. The Library lists files
from the `org_fs_entry` index, which only the /api/:org/fs routes write, so an
agent that uploads to `_fs/home/pages/x.html` through a presigned URL gets
bytes in the bucket and nothing in the Library; a raw delete leaves an index
row with no bytes behind.

Reject `_fs/` keys in those three tools (normalized like buildS3Key, so
`a/../_fs/x` and encoded spellings count) and point to the fs route. Fix the
decocms-studio skill, whose rest.md told agents to prefer those tools while
the line above it said to write files through `fs`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* feat(web): point Connect at the decocms-studio skill and CLI login

The Connect page only offered MCP snippets, and an agent connected that way
has no route to write Library files. Put the skill install and the one-time
`decocms auth login` first, and keep MCP below for clients without a shell.

The skill now tells the agent to hand the user the login command instead of
working around a missing session, to stat a file before saying it is in the
Library, and how to link and share it (public or password).

* feat(web): switch Connect between CLI + skill and MCP tabs

CLI + skill opens first and carries a Recommended badge; MCP keeps its client
tabs and install method inside its own tab.

* feat(web): pick the client in the skill install step

The install step gets the same Claude / Cursor / Codex / Other tabs as MCP,
sharing one selection. Cursor and Codex pass -a to the skills CLI; Other lets
it ask.

* docs(plugin): tell the agent how to get Bun; link Bun from Connect

The CLI needs the Bun runtime even under npx, so the skill now has the agent
offer to install Bun when bunx is missing, and the Connect hint links to it.

* feat(api): write and delete Library files through the object-storage tools

Instead of rejecting _fs/ keys, PUT_PRESIGNED_URL hands out a Studio upload
URL carrying a signed, one-file grant (at most an hour), and the new
PUT /api/:org/fs/:volume/upload/:token route writes it through OrgFs, so the
file lands in the Library index. DELETE_OBJECT(S) delete _fs/ keys through
OrgFs too, and remove bytes a raw write left unindexed.

Both apply the fs routes' rules (public and synced volumes read-only,
personal folders owner-only); the upload route checks them again at upload
time. The HMAC grant code shared with Jira attachment downloads moves to
core/signed-grant.ts, and upload grants carry a purpose field so another
grant type signed with the same key never passes.

* fix(web): say what MCP clients still need the CLI for

Library writes work over MCP now; sharing files and messaging agents remain
REST-only.

* test(e2e): expect the Connect page's skill-first heading and tab

---------

Co-authored-by: Guilherme Rodrigues <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
PR: #7885 feat: Library writes through the object-storage tools, and Connect leads with the decocms-studio skill
Bump type: minor

- decocms (apps/api/package.json): 4.470.0 -> 4.471.0
- @decocms/native (apps/native/package.json): 4.470.0 -> 4.471.0
- @decocms/e2e (packages/e2e/package.json): 1.104.0 -> 1.105.0

Deploy-Scope: both
… 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
The three sandbox content files were added on both sides; fold/v8-web's are the fixed ones (listing through a file, rollback of the file in flight), so this tree equals fold/v8-web's.

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

Copy link
Copy Markdown
Contributor Author

Folded into #7887 (API) / #7888 (web, stacked on #7887). The tree of #7888 equals this stack's top (split/51-v8-per-site). The branch is kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

@tlgimenes tlgimenes closed this Oct 13, 2026
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