Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
- name: Test
run: npm test -- --coverage

- name: Collaboration service tests
run: npm run test:collaboration

- name: Edge function tests
run: npm run test:edge

Expand Down
12 changes: 6 additions & 6 deletions .hermes/plans/2026-09-20_131317-debate-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ Each numbered slice is independently reviewable. Before implementation, write it

**P0.1 Editor and durability spike.** Proposed new paths: `src/lib/workspace/editor-schema.ts`, `src/test/workspace/collaboration.test.ts`, `services/collaboration/package.json`, `services/collaboration/src/server.ts`, and `services/collaboration/src/server.test.ts`. Modify existing `package.json` and `package-lock.json` only after dependency/license review. Keep the spike isolated from production routes.

- [ ] Resolve current compatible Tiptap/Yjs/Hocuspocus versions from official docs and package manifests, pin exact versions, inspect licenses, and verify React 18/Node 22 compatibility. Record rejected alternatives and extension licensing.
- [ ] Write a two-client actual-Y.Doc test that edits the same paragraph, changes list formatting, inserts a link, disconnects, reconnects, and checks identical structured results. Write a local undo test proving a teammate's text survives.
- [ ] Add a gateway test that forces database append failure, duplicates an update, and kills the process before and after durable ack. Assert no Saved acknowledgement before commit and no acknowledged loss after restart.
- [ ] Prove the full update interception path, including sync handshake. Record hook order from the selected version and ensure rejected mutations never appear to other clients.
- [ ] Add a restore-epoch test where an offline client's old tail returns. Assert the selected version remains current and old edits enter recovery.
- [ ] Run `npx vitest run src/test/workspace/collaboration.test.ts`; add and run a proposed root `test:collaboration` npm script for the real Node-service tests. No spike is accepted on a mocked Yjs merge.
- [x] Resolve current compatible Tiptap/Yjs/Hocuspocus versions from official docs and package manifests, pin exact versions, inspect licenses, and verify React 18/Node 22 compatibility. Record rejected alternatives and extension licensing.
- [x] Write a two-client actual-Y.Doc test that edits the same paragraph, changes list formatting, inserts a link, disconnects, reconnects, and checks identical structured results. Write a local undo test proving a teammate's text survives.
- [x] Add a gateway test that forces database append failure, duplicates an update, and kills the process before and after durable ack. Assert no Saved acknowledgement before commit and no acknowledged loss after restart.
- [x] Prove the full update interception path, including sync handshake. Record hook order from the selected version and ensure rejected mutations never appear to other clients.
- [x] Add a restore-epoch test where an offline client's old tail returns. Assert the selected version remains current and old edits enter recovery.
- [x] Run `npx vitest run src/test/workspace/collaboration.test.ts`; add and run a proposed root `test:collaboration` npm script for the real Node-service tests. No spike is accepted on a mocked Yjs merge.

**P0.2 Suggestions and import/export fidelity spike.** Proposed new paths: `src/test/workspace/review.test.ts`, `src/test/workspace/document-conversion.test.ts`, and small fixture files under `src/test/workspace/fixtures/` during implementation.

Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ npm run docs:check
npm run lint
npm run typecheck
npm test -- --coverage
npm run test:collaboration
npm run test:edge
npm run build
CI=1 PORT=18080 PLAYWRIGHT_BASE_URL=http://127.0.0.1:18080 npm run test:e2e
Expand Down
10 changes: 10 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ Follow existing functional React, Zustand, Zod, and shadcn/Radix patterns. Reuse

Run the closest unit or component test while changing behavior. Run lint, type checking, and build before handing work off.

## Collaboration service spike

The Phase 0 service evidence lives under `services/collaboration/`. Run:

```bash
npm run test:collaboration
```

The spike is not a deployed service. Its in-memory writer lock is single-process evidence; the database-backed service and advisory-lock lifecycle belong to P2.1.

## Edge Function workflow

Edge Functions live under [`supabase/functions/`](../supabase/functions/). Shared server code belongs in `_shared` only when at least two functions use the same boundary or policy.
Expand Down
15 changes: 12 additions & 3 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ npx vitest run src/test/security/url-validation.test.ts

For a bug, watch the reproduction fail for the expected reason before implementing the fix.

## Collaboration service tests

```bash
npm run test:collaboration
```

This runs the isolated Node service spike with real Hocuspocus providers and Yjs documents. It covers durable acknowledgement ordering, reconnect sync, duplicate delivery, schema and size rejection, writer serialization, stale epochs, and process-kill recovery. It does not prove PostgreSQL advisory locks or a deployed collaboration service.

## Edge Function tests

```bash
Expand Down Expand Up @@ -91,9 +99,10 @@ The gate runs, in order:
2. lint
3. type checking
4. selected-scope coverage
5. native Edge Function tests
6. production build
7. desktop and mobile Chromium
5. collaboration service tests
6. native Edge Function tests
7. production build
8. desktop and mobile Chromium

It does not start local Supabase, run pgTAP, run WebKit, or use protected staging.

Expand Down
Loading
Loading