Skip to content

feat: add node update endpoint and table LLM context fields#33

Merged
ajainvivek merged 2 commits into
mainfrom
feat/node-table-update-endpoints
Mar 12, 2026
Merged

feat: add node update endpoint and table LLM context fields#33
ajainvivek merged 2 commits into
mainfrom
feat/node-table-update-endpoints

Conversation

@ajainvivek
Copy link
Copy Markdown
Contributor

Summary

  • New endpoint PATCH /v1/documents/:id/nodes/:node_id — update individual document nodes (title, summary, content, image_path, and all metadata fields including attributes and cross-references)
  • Table LLM context fields — added domain_vocab, context, instructions, and tags as first-class fields on the Table model; exposed via the existing PATCH /v1/tables/:id endpoint
  • Docs updated — OpenAPI spec, utoipa Swagger UI registration, and the Tables guide all reflect the new endpoints and fields

Changes

crates/reasondb-core/src/model/table.rs

  • Added domain_vocab: Option<Vec<String>> — domain terms for LLM reasoning
  • Added context: Option<String> — contextual description for LLM
  • Added instructions: Option<String> — custom LLM query/reasoning directives
  • Added tags: Option<Vec<String>> — classification tags

crates/reasondb-server/src/routes/tables.rs

  • Extended UpdateTableRequest and TableResponse with the 4 new fields
  • Handler applies each field when Some(...)

crates/reasondb-server/src/routes/documents.rs

  • Added UpdateNodeMetadataRequest, UpdateNodeRequest, NodeDetail structs
  • Added update_node handler with ownership validation (node must belong to the given document)

crates/reasondb-server/src/routes/mod.rs

  • Registered PATCH /v1/documents/:id/nodes/:node_id

docs/api-reference/openapi.json

  • Updated UpdateTableRequest and TableResponse schemas
  • Added UpdateDocumentRequest, UpdateNodeMetadataRequest, UpdateNodeRequest, NodeDetail schemas
  • Added PATCH operation to /v1/documents/{id}
  • Added /v1/documents/{id}/nodes/{node_id} path with PATCH operation

docs/guides/tables.mdx

  • Updated Table Schema table with new fields
  • Added "Configuring LLM Context" sub-section with curl examples

crates/reasondb-server/src/openapi.rs

  • Registered update_document and update_node in utoipa ApiDoc

Test plan

  • PATCH /v1/tables/:id with domain_vocab, context, instructions, tags — verify fields are persisted and returned in GET /v1/tables/:id
  • PATCH /v1/documents/:id/nodes/:node_id with title, summary, content — verify updated node returned
  • PATCH /v1/documents/:id/nodes/:node_id with metadata.attributes — verify attributes are merged not replaced
  • PATCH /v1/documents/:id/nodes/:wrong_doc_id — verify 404 when node doesn't belong to document
  • Confirm Swagger UI at /swagger-ui shows new endpoints and schemas

- Add PATCH /v1/documents/:id/nodes/:node_id endpoint to update individual
  document nodes (title, summary, content, image_path, metadata)
- Add domain_vocab, context, instructions, and tags as first-class fields
  on the Table model for guiding LLM reasoning per table
- Extend PATCH /v1/tables/:id to accept and persist the new fields
- Update OpenAPI spec and utoipa ApiDoc to reflect all new endpoints
  and schemas (UpdateNodeRequest, NodeDetail, UpdateDocumentRequest, etc.)
- Update docs/guides/tables.mdx with new schema fields and a
  "Configuring LLM Context" section with curl examples
…d-trip test

The new domain_vocab, context, instructions, and tags fields used
skip_serializing_if = "Option::is_none" which breaks bincode serialization
since bincode uses positional encoding and cannot skip fields mid-stream.
Removing skip_serializing_if (keeping serde(default) for JSON back-compat)
fixes test_table_serialization. The API response omission is handled by
TableResponse in routes/tables.rs which correctly uses skip_serializing_if.
@ajainvivek ajainvivek merged commit 3f9453b into main Mar 12, 2026
3 checks passed
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.

1 participant