Commit Graph
24 Commits
Author SHA1 Message Date
DarkSky 9cd813275b refactor(server): isolate v0.27.5 compatibility code and track its exit
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.
2026-11-27 05:48:02 +09:00
DarkSky 302e3d853d refactor(server): align transcript upload limits and trim hot paths
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.
2026-11-27 05:47:27 +09:00
DarkSky f46af9a696 feat(server): add DynamicBlobStorage hot reload for copilot.storage 2026-11-27 02:47:56 +09:00
DarkSky b5b4fcb7e0 feat(backend): add Copilot embedding SPI and GraphQL resolvers 2026-11-26 19:02:48 +09:00
DarkSky 1ec9019fcb feat(server): add copilot transcript SPI and GraphQL contract 2026-11-26 17:59:24 +09:00
DarkSky 6b74655aee feat(server): add BYOK SPI and GraphQL contract surface 2026-11-26 09:00:57 +09:00
DarkSky 719a791c0c feat(server): add copilot graphql surface and rest routes
Expand CopilotRuntimeSpi with neutral session, history, quota, route
option, attachment, and SSE streaming methods. Add the matching Copilot
GraphQL types, UserType.copilot and UserType.quotaUsage resolvers,
ServerFeature::Copilot gating, canonical error mappings, and the seven
/api/copilot/* REST routes in server-http.
2026-11-26 07:37:49 +09:00
DarkSky 70173e6565 feat(backend): add billing GraphQL resolvers, SPI, and disposition handler 2026-11-25 21:40:22 +09:00
DarkSky 8c9f4512d5 feat(backend): add public HTTP surfaces and maintenance workers
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.
2026-11-25 18:55:14 +09:00
DarkSky 69bacafdad feat(http): wire multipart blob routes, storage hot-reload, and boot_storage 2026-11-25 18:55:14 +09:00
DarkSky 51c7cd31a5 feat(server): add workspace MCP credentials, GraphQL resolvers, and stateless JSON-RPC transport 2026-11-25 14:10:29 +09:00
DarkSky 55adbc6080 feat(server): add calendar sync service, GraphQL resolvers, and webhook REST routes 2026-11-25 14:10:29 +09:00
DarkSky c043f6c7ac feat(server): add security challenges, signing key rotation, and UserType.token
Implement single-transaction security challenges (email verification, password change/set, email change with percent-decoding and realtime user-updated fan-out), admin session signing key rotation/deletion with strict verify_until boundary and parent token TTL policy, UserType.token, Query.error, and GraphQL strict throttling.
2026-11-25 10:01:21 +09:00
DarkSky 2f41f8977c feat(server): add login OAuth/OIDC, PostgreSQL captcha, and strict throttling
Implement OAuth/OIDC preflight, atomic runtime_states claim (3h TTL), bounded TTL discovery/JWKS caching, ring/p256 JWT verification across RS/PS/ES algorithms, Apple args secret normalization, PostgreSQL-backed Hashcash and Turnstile captcha, and request-level strict throttling.
2026-11-25 09:56:04 +09:00
DarkSky ed2852614d feat(server): add admin console workspace, dashboard, shared-link, and mail-delivery queries
- Add AdminService in server-domain for workspace listing, counts, details, member/shared-link lookups, workspace updates, dashboard metrics, shared-link pagination, and mail-delivery aggregates.
- Expose adminWorkspaces, adminWorkspacesCount, adminWorkspace, adminUpdateWorkspace, adminDashboard, adminAllSharedLinks, and adminMailDeliveries in server-http GraphQL.
- Update packages/backend/AGENTS.md with AdminService and admin console query documentation and extend integration tests.
2026-11-25 09:24:01 +09:00
DarkSky f218b68e4b feat(server): add admin user management, config validation, doc analytics, and realtime topic tests
- 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.
2026-11-25 09:21:34 +09:00
DarkSky 9603b4b762 feat(server): add SQL manifest, safe_fetch, route matrix, and client version guard
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.
2026-11-25 04:12:12 +09:00
DarkSky 42a52df55c fix(server-domain): box partial cleanup on DeleteUserError 2026-11-24 23:58:11 +09:00
DarkSky af0d124d5d feat(server): add lockless compaction CAS, search projection v6, and server-search
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.
2026-11-24 23:36:03 +09:00
DarkSky 1d6fd58258 feat(backend): add doc sharing, histories, comments, notifications, open-app, and license
Add Rust domain services, GraphQL resolvers, REST routes, and realtime RPC
handlers for public docs, grants, histories, comments, notifications, user
settings, Open-App sign-in, and self-hosted licenses.

- Add DocSharingService, public-docs routes, y-octo root-doc filtering, and
  realtime share-state and grants RPCs.

- Add DocHistoryService, snapshot recovery, update compaction, and expired
  record cleanup.

- Add CommentService, NotificationService, user settings, Open-App codes,
  SelfhostLicenseService, and BillingSpi.

- Run 9 deterministic Cloud E2E specs in CI, remove waitForTimeout calls,
  and add collaboration parity checks.
2026-11-24 17:25:29 +09:00
DarkSky ae1bd232db feat(server): add public API parity and cloud E2E cutover for affine-server
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).
2026-11-24 07:59:26 +09:00
DarkSky dece75f25a feat(server): add billing subject, rate limit SPI, and userspace mutex
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.
2026-11-23 20:24:28 +09:00
DarkSky c245d8e1f7 feat(server): add domain, mail, blob, sync services and writing rules
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.
2026-11-23 16:04:20 +09:00
DarkSky b375374c7f refactor(server): move server crates under packages/backend and upgrade y-octo to 0.4.0
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.
2026-11-23 15:12:26 +09:00