Move the userspace SessionRedis lock bridge and the lazy root doc lifecycle
migration into server-sync/src/legacy_compat. Mark every remaining
v0.27.5 compatibility point with a compat tag.
Add docs/post-cutover-ablation-backlog.md with the exit check and removal
scope of each tag. L0 Tier A gate 7 now checks that tags and entries match
one to one.
Return 403 ACTION_FORBIDDEN while Copilot is off.
Parse multipart GraphQL requests with the v0.27.5 upload limits. A
non-file field holds at most 1000000 bytes, a file at most 100 MiB, and a
request at most 32 files and map entries. Each limit returns 413 Payload
Too Large.
Limit JSON GraphQL bodies to 16 MiB.
Keep transcript slices in their upload files and leave the 50 MiB slice
check to the transcript runtime, after its duplicate-task check. Drop the
total upload cap. Read at most 100 MiB in setBlob.
Close dedicated session connections on every exit path. Take the domain
workspace lock with one blocking advisory lock.
Cache the search projection probe per storage. Compute
StorageBackendSpec::backend_identity without a client.
Use one millisecond renew script in server-worker. Split the node-semver
parser out of version_guard, and bound the invalid range log.
Remove the manifest test hook from the assetpack read path.
Implement static asset hosting (Selfhost and Front canary Web Mobile shell), SSR document renderer with ACL-backed preview exposure, HTML head/avatar OG metadata, and iterative bounded Markdown rendering skipping affine:surface and edgeless notes, worker proxy (image-proxy and 2 MiB link-preview) with bounded cache and shared Redis Hash Lua/memory throttling with SHA-256 tracker hashing, telemetry collection with shared version/throttle guards, per-method invalid origin messages, and bounded param flattening, GraphQL CR comment depth pre-scan hardening, and periodic background maintenance workers with slash-separated advisory locks and pending-updates backlog gauge.
- Implement admin user CRUD, feature updates, batch import, enable, and recreate-for-ban transaction semantics in UserService.
- Derive ServerConfigType oauthProviders and OAuth/Captcha feature flags dynamically from app_configs and resolve availableUpgrade on demand via safe_fetch.
- Add appConfigMetadata and dry-run validateAppConfig with secret redaction and env-only key rejection.
- Add workspaceRolePermissions and DocType analytics/lastAccessedMembers with Doc.Read and Doc.Analytics permission checks.
- Wire WorkspaceService to EventBusPublisher for single notification.count.changed emission on invite, accept, and approve flows and add integration tests.
Add the server foundation contracts for SQL execution order, outbound SSRF
protection, deployment and role route isolation, and client version control:
- Add the ordered SQL manifest (`packages/backend/server-db/sql-manifest.json`)
and check manifest coverage and SHA-256 digests in `check-l0-tier-a.mjs`.
- Add `server_domain::safe_fetch` with pinned DNS resolution, per-origin
private network allowlist, redirect header filtering, cross-origin body
replay blocking, and legacy error envelope mapping.
- Add `RouteMountMatrix` across `(DeploymentMode, dev_mode, ServerRole)` with
modular REST and GraphQL route wiring and `ServerExtension` isolation.
- Enforce `client.versionControl` with cached `AppConfigService` snapshots,
anonymous fast-path short-circuiting, npm semver range parsing, named guard
coverage on public auth endpoints, and read-only cookie session resolution
with TTR refresh.
Refactor document compaction and search projection to remove cross-workspace lock contention and hold zero locks during CRDT merges.
Document compaction and user deletion changes:
- Replace single-transaction compaction with lock-free reads, owned-permit blocking CRDT merges, and short strict-CAS write transactions.
- Retry compaction on snapshot or update CAS mismatches and PostgreSQL 40P01 deadlocks.
- Replace full-table pending update grouping with a rotating primary-key loose index scan and per-batch quota cache.
- Delete owned personal workspaces in individual short transactions with post-lock Team verification and partial cleanup returns.
Connection, rate-limit, and test harness changes:
- Set default statement and idle transaction timeouts on dedicated PostgreSQL session connections.
- Run deferred invite rate-limit effects only after rejected invite transactions roll back cleanly.
- Pass prebound SMTP sinks in parity-harness replay tests to eliminate ephemeral port races.
Search projection v6 and pure-Rust runtime changes:
- Add search_projection_v6.sql with per-workspace advisory locks, post-lock mode re-checks, and a 30s pre-expiry dual-lock bridge.
- Skip steady-state workspace_states updates during ordinary document snapshot writes to remove hot-row contention.
- Validate forward-compatible contiguous prefixes in native_schema_migrations during rolling upgrades.
- Add pure-Rust server-search (disabled by default) with committed marker-XID fences, deferred GC progress retention, repeatable-read ACL snapshots, and GraphQL resolvers.
Add public-repo API parity to `affine-server` and run the core cloud
Playwright suite against the Rust all-in-one server.
- Add HS256 Bearer access tokens, native session exchange, refresh,
revoke, and list REST endpoints, login preflight, profile updates,
WebP avatar transcoding and safe removal, and a distributed-locked
expired-session cleanup worker with background lease renewal.
- Unify workspace and per-document ACL evaluation (`acl.rs`), split
REST and GraphQL modules, and add workspace member management,
ownership transfer with readonly and quota invalidation guards, atomic
invite links, `createWorkspace(init)` transactional root snapshots,
`DocType`, `DocPermissions`, `createBlobUpload`, `calendarProviders`,
and SocketIO realtime workspace access and config rooms.
- Extract reachable blob keys with `y-octo` bounded BFS under
`REPEATABLE READ` snapshots with pre-merge budgets and bounded caching,
check per-doc ACL and reserved doc isolation on source-scoped blob
routes, paginate `readable-blob-manifest/v1` with SQL cursor pushdown,
and reject legacy blob reads with `403 UNSUPPORTED_CLIENT_VERSION`.
- Keep fresh DB bootstrap on the default v1 sync protocol until
activated, and accept both absent (v1) and active (v2) lifecycle
checkpoints on existing databases.
- Add `AFFINE_E2E_RUST_SERVER=1` Playwright support and a
`cloud-e2e-rust-server` CI job, extend the live parity scenario to
23 steps, and lower `waitForTimeout` usage from 336 to 312 (ratchet
from 324 to 316).
Add `BillingSubject` to `AccessGrant` in `server-types` and re-export it from `server-spi`.
Remove the direct `entitlements` SQL query from `UserType::quota` in `server-http`.
Resolve personal storage quota from `AccessGrant.billing_subject` alone.
Add `RequestSource`, async `RateLimitPolicy`, and `CommunityRateLimitPolicy` to `server-spi` and `ServerExtension`.
Remove duplicate `AuthMailQuotaPolicy` from `server-domain`, add pure-Rust `contains_url_or_domain`, and add batch `invite_members_with_source`.
Wire `RateLimitPolicy` with on-demand `RequestSource` into `AuthService`, `WorkspaceService`, `server-http`, and `affine-server`.
Add `InvalidationHintV1::QuotaEntitlement` and `serve_with_extension_and_init` for startup hooks before serving requests.
Upgrade `RedisMutex` in `server-worker` with cached connections, lock-free connect, cancel-safe Lua lock retry, pre-commit fencing, and cancel-safe release.
Wire `server-sync` userspace writes (`MutexLock:userspace:<user_id>:<doc_id>`) to `RedisMutex` on `SessionRedis` with millisecond timestamps, upfront DB permits, lease renewal, and pre-commit fence rollback.
Handle empty-table insert conflicts via `ON CONFLICT DO NOTHING` with a `FOR UPDATE` merge fallback.
Update `packages/backend/AGENTS.md` and ignore pre-signed native license JSON in `.prettierignore` and `.oxlintrc.json`.
Extend `scripts/ci/check-l0-tier-a.mjs` to block non-test `entitlements` SQL queries in `server-http` and check documented Rust types.
Replace 22 active `waitForTimeout` calls in 12 local E2E specs with state assertions and lower `scripts/ci/l0-ratchet.json` from 358 to 336.
Add server-domain, server-mail, server-blob, and server-sync under packages/backend with y-octo 0.4.0.
Wire auth, blob, mail worker, and Socket.IO routes into server-http and affine-server.
Extend the parity harness and CSF frame audit checks.
Fix mail error redaction, expired terminal error codes, database clock reads in blob checks, and permission docs.
Add the STE writing skill and update AGENTS.md rules.
Move the server Rust workspace directly under packages/backend.
Exclude native and server from that workspace.
Move frame-audit to tools/frame-audit as a standalone crate.
Isolate packages/backend/native under the root workspace.
Upgrade y-octo to 0.4.0 in native-playground and remove the old removal workarounds.
Update CI workflows, static gates, and docs for the new paths.