The Batch-11 notes backend ends browser-only persistence. A FastAPI service at /runtime/document-note-service/ (port 8091 default) provides CRUD + aggregate endpoints. The Universal Document Shell calls the backend when reachable; otherwise it falls back to the Batch-6 localStorage path with a visible OFFLINE badge.
Backend Batch 11 ปิดการพึ่ง browser อย่างเดียว · FastAPI ที่ port 8091 · shell เรียก backend ก่อน · ถ้าไม่ถึงใช้ localStorage แบบ offline ที่มีป้ายชัด
Notes now persist across browsers via a real backend. Local/dev only · single-writer · no auth on notes endpoints.
Notes เก็บข้ามเบราว์เซอร์ได้ด้วย backend จริง · local/dev · writer เดียว · endpoint ไม่มี auth
7 endpoints: health, create, list, patch, delete, aggregate, by-doc. Storage is a single JSON file rewritten atomically on every mutation. 14-field schema from Batch 6 is honored byte-for-byte. When the backend is up, the shell writes there; when it is down, localStorage takes over.
7 endpoints · เก็บไฟล์ JSON เดียว · rewrite แบบ atomic · schema 14 ฟิลด์เหมือน Batch 6 · backend ทำงาน = เขียนไป backend · ไม่ทำงาน = ใช้ localStorage
| Method | Path | Purpose |
|---|---|---|
| GET | /api/notes/health | liveness + counts |
| POST | /api/notes/create | create note (doc_id + title required) |
| GET | /api/notes/list[?doc_id=…] | list (optionally filtered) |
| PATCH | /api/notes/{note_id} | status / linked_change_ref / title / body / priority |
| DELETE | /api/notes/{note_id} | hard delete |
| GET | /api/notes/aggregate | counters + top-5 open docs + recent activity |
| GET | /api/notes/by-doc | per-doc summary |
Full contract: notes_contract.json
docs/runtime/document-note-service/notes_store.jsonos.replacefsync in this batch (acceptable for dev)On DOMContentLoaded, document-shell.js probes /api/notes/health. When OK, NOTES_MODE='backend' and the notes tab rewires its create/list/patch/delete through the backend. When probe fails, NOTES_MODE='offline' and the Batch-6 localStorage path stays active. The mode is rendered in the summary counter under Backing.
Base URL: <html data-ds-notes-base> → window.DS_NOTES_BASE → default http://127.0.0.1:8091. Set none to disable.
When the backend is unreachable, the shell continues the Batch-6 localStorage path for the current browser. Aggregate/backlog views read from whichever source is live — backend first, local second — and the page shows the active mode honestly.
Notes created offline stay browser-local until you manually POST them to /api/notes/create. Automatic re-sync is deferred to Batch 12+.
last_action_at| Date | Change |
|---|---|
| 2026-04-20 | v1.0 · initial · Batch 11 |