Skip to content

feat: room↔document junction table (schema v15)#692

Merged
ajianaz merged 4 commits into
developfrom
feat/room-document-association-689
Jul 15, 2026
Merged

feat: room↔document junction table (schema v15)#692
ajianaz merged 4 commits into
developfrom
feat/room-document-association-689

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds room_documents junction table (schema v15 migration) enabling explicit room-to-document linking beyond the automatic memory [[doc-slug]] wikilinks from PR #691.

Schema change

CREATE TABLE IF NOT EXISTS room_documents (
    room_id  TEXT NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,
    doc_slug TEXT NOT NULL,
    added_at TEXT NOT NULL,
    PRIMARY KEY (room_id, doc_slug)
);

Store methods

Method Description
room_add_document(room_id, doc_slug) Link doc to room (INSERT OR IGNORE)
room_remove_document(room_id, doc_slug) Unlink doc from room
room_list_documents(room_id) Get all doc slugs linked to room
document_list_rooms(doc_slug) Get all room IDs linked to doc

Server endpoints

Endpoint Method Body
/room/document/add PUT {room_id, doc_slug}
/room/document/remove DELETE {room_id, doc_slug}
/room/document/list POST {room_id}{doc_slugs}
/doc/room/list POST {doc_slug}{room_ids}

Test results

  • 299/303 pass ✅
  • 4 pre-existing dream::tests failures (ONNX unavailable)

Refs #689

"CREATE TABLE IF NOT EXISTS room_documents (
room_id TEXT NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,
doc_slug TEXT NOT NULL,
added_at TEXT NOT NULL,
CREATE TABLE IF NOT EXISTS room_documents (
room_id TEXT NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,
doc_slug TEXT NOT NULL,
added_at TEXT NOT NULL,
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review recommended — warnings found.

🟡 Warning (1)

  • unknown:? — Cora AI review could not complete: failed to parse LLM JSON response: parse failed (original: EOF while parsing a value at line 1 column 0, after repair: EOF while parsing a value at line 1 column 0). Review was skipped; no code quality issues were found by the automated check.

Review powered by cora-cli · BYOK · MIT

ajianaz added 2 commits July 15, 2026 16:06
New room_documents table with room_id + doc_slug composite PK.
Enables explicit room-to-document linking beyond memory wikilinks.

Store methods:
- room_add_document(room_id, doc_slug)
- room_remove_document(room_id, doc_slug)
- room_list_documents(room_id) → Vec<slug>
- document_list_rooms(doc_slug) → Vec<room_id>

Server endpoints:
- PUT /room/document/add
- DELETE /room/document/remove
- POST /room/document/list
- POST /doc/room/list

Refs #689
- Add room_add_document, room_remove_document, room_list_documents,
  document_list_rooms to Uteke public API (rooms.rs)
- Replace uteke.store.xxx with uteke.xxx in server handlers
- Add missing ns binding in /tags GET handler
- Apply cargo fmt
@ajianaz ajianaz force-pushed the feat/room-document-association-689 branch from 22ab895 to 0e6709a Compare July 15, 2026 09:06
ajianaz added 2 commits July 15, 2026 16:14
The handlers used json!() which is not in scope — must be
serde_json::json!() to match the rest of handlers.rs.
@ajianaz ajianaz merged commit 14b8c3f into develop Jul 15, 2026
9 checks passed
@ajianaz ajianaz deleted the feat/room-document-association-689 branch July 15, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants