Until now the markdown importer was one-way (plans/*.md → DB). Any
agent-driven status flip via claim_task / complete_task would be
clobbered on the next importer sweep. This change closes the loop: the
DB now projects status, priority, agent_prompt, and updated_at back
into the file's frontmatter, preserving body bytes, key order, and
every other frontmatter key.
New: packages/database/src/markdown-backlog/export.ts
- `rewriteFrontmatter()` — pure function, covered by 10 Vitest cases
(round-trip identity, status flip, priority flip, agent_prompt
null/block-scalar/single-line variants, body preservation,
trailing-newline preservation, idempotent re-application).
- `exportBacklogItemToMarkdown()` — DB-loading wrapper with atomic
write (tmp + rename) and tenant fencing. Returns a structured
result so callers can surface what happened in their response.
Wired into:
- `claim_task` MCP tool — exports on the ready → in_progress flip.
- `complete_task` MCP tool — exports on any finalStatus transition.
- `backlog.updateWorkflowPrompt` tRPC mutation — exports on prompt
edits made through the app UI.
Robust repo-root resolution (`apps/{mcp-server,web}/src/lib/repo-root.ts`,
plus a copy in `import-markdown-backlog.ts`): walk up from the source
file looking for `pnpm-workspace.yaml`, falling back to env var or cwd.
This fixes a class of bug where `pnpm --filter <pkg>` cd's into the
package directory and breaks naive cwd-based path resolution — the
importer was deleting all 44 rows during smoke testing before this fix
because it found zero files in `packages/database/plans/`.
`config/CursorSync.md`: documents the new two-way contract, the
DB-wins-on-allow-list conflict policy, and the
MARKDOWN_BACKLOG_REPO_ROOT=off escape hatch for production deployments
where `plans/` isn't checked out.
Smoke verified end-to-end against the homelab DB: claim flips file
status to in_progress, complete flips it back to ready, importer
round-trips with stable content_hash (true no-op), agent identity
preserved throughout.
Co-authored-by: Cursor <cursoragent@cursor.com>
3.6 KiB
| kind | slug | title | plan_slug | epic_slug | status | priority | tenant_id | owner | cursor_todo_id | updated_at |
|---|---|---|---|---|---|---|---|---|---|---|
| task | smoke-test-collab-editor | Smoke-test TipTap + Yjs + Hocuspocus across two browsers on deployed stack | daily-driver-finish | shipping-the-shell | ready | P1 | global | unassigned | null | 2026-06-03 |
Task summary
The TipTap + Yjs + Hocuspocus stack works in dev. Before declaring Echodo daily-usable, verify two browsers on the deployed collab service can edit the same document without drift, disconnect, or auth issues.
Description
This is a verification task, not a feature task. It has two parts: build a checklist, run the checklist, document the result.
Pre-flight
- Deploy must be up. CT 102 (Postgres/Redis), CT 107 (Coolify web), collab service running and reachable.
- A test workspace must exist with at least one document object.
- Two browsers with different sign-ins (use credentials provider for both — fastest path).
Checklist
- Browser A opens the document. Verify cursor appears and TipTap loads.
- Browser B opens the same document. Verify B sees A's content.
- A types a paragraph. B should see it within ~200ms.
- B types in a different paragraph simultaneously. Both should converge without lost characters.
- A goes offline (devtools network → offline), types, comes back online. Yjs should reconcile A's offline edits.
- Kill the Hocuspocus process; clients should reconnect when it comes back (verify in
apps/collab-server/src/index.tslogs). - Close both browsers. Reopen. Verify content persisted in Postgres (Hocuspocus database extension).
Output
Write the result up as a comment block in apps/collab-server/README.md (create if missing) — a one-screen "verified on $DATE against $COMMIT_SHA, here's what works" note. Future operators need to know whether this stack is trusted or risky.
If you find a regression
Don't fix it in this task. File a follow-up task in the same epic and flag the issue clearly. This task is verification; fixes are scoped separately so the verification has a clean before/after.
Subtasks
- Verify deploy is live on CT 107 with collab server reachable.
- Run the 7-step checklist above.
- Write the result block in
apps/collab-server/README.md. - File any regression follow-ups as new tasks under this epic.
Agent-side prep (already done)
The pieces an agent can verify without a live deploy + two browsers were checked as Path A landed:
pnpm lint && pnpm type-checkis green across all 6 packages, including@tasks/collab-server.apps/collab-server/tsconfig.jsonwas cleaned up in commit1c9deea(removed vestigialrootDir/declaration/outDir/etc.).- The auth changes that landed in commit
875b1cf(Authentik SSO, case-insensitive emails, first-signin workspace provisioning) and subsequent Path-A commits do not touch the Hocuspocus auth path inapps/collab-server/src/index.ts. The session model the collab server reads from is unchanged. - Workspace home, AI chat, and landing-route changes are all confined to
apps/weband don't import or affect anything underapps/collab-server.
So the static health is fine. What's left is the live multi-browser test against the deployed stack, which has to be driven by an operator with the homelab credentials and two browser sessions in hand.
Owner or assignee
Unassigned
Status
ready
Estimation
S
Acceptance criteria
- All 7 checklist items pass, or any failures are filed as separate tasks.
- Result block exists in
apps/collab-server/README.mdwith date and commit SHA.
Links to related Epic / Plan
- Epic:
./Epic-shipping-the-shell.md - Plan:
../Plan-daily-driver-finish.md