feat: add node update endpoint and table LLM context fields#33
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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)domain_vocab,context,instructions, andtagsas first-class fields on theTablemodel; exposed via the existingPATCH /v1/tables/:idendpointChanges
crates/reasondb-core/src/model/table.rsdomain_vocab: Option<Vec<String>>— domain terms for LLM reasoningcontext: Option<String>— contextual description for LLMinstructions: Option<String>— custom LLM query/reasoning directivestags: Option<Vec<String>>— classification tagscrates/reasondb-server/src/routes/tables.rsUpdateTableRequestandTableResponsewith the 4 new fieldsSome(...)crates/reasondb-server/src/routes/documents.rsUpdateNodeMetadataRequest,UpdateNodeRequest,NodeDetailstructsupdate_nodehandler with ownership validation (node must belong to the given document)crates/reasondb-server/src/routes/mod.rsPATCH /v1/documents/:id/nodes/:node_iddocs/api-reference/openapi.jsonUpdateTableRequestandTableResponseschemasUpdateDocumentRequest,UpdateNodeMetadataRequest,UpdateNodeRequest,NodeDetailschemasPATCHoperation to/v1/documents/{id}/v1/documents/{id}/nodes/{node_id}path withPATCHoperationdocs/guides/tables.mdxcrates/reasondb-server/src/openapi.rsupdate_documentandupdate_nodein utoipaApiDocTest plan
PATCH /v1/tables/:idwithdomain_vocab,context,instructions,tags— verify fields are persisted and returned inGET /v1/tables/:idPATCH /v1/documents/:id/nodes/:node_idwithtitle,summary,content— verify updated node returnedPATCH /v1/documents/:id/nodes/:node_idwithmetadata.attributes— verify attributes are merged not replacedPATCH /v1/documents/:id/nodes/:wrong_doc_id— verify 404 when node doesn't belong to document/swagger-uishows new endpoints and schemas