Build item_get and item_list v2 #313
Description
Read tools from #309. Includes the paging contract of #304 and the partial reads of #305. Built on the existing data model behind one history interface, so #320 swaps only the storage. Start from the descriptions measured in tests/Conderis.Tests/ToolSurface/V2Prototype.cs.
item_get
numberorref(instructions,memory:<id>for personal memories,proposal:<id>);projectIdoptional for personal memories.- Returns the item, its direct relations as short entries and its
version. Nodepth. history: truereturns history metadata per version (version, author, time, changed fields);versionreads the text as it was at that version. No revision id in the response.offset/takeper #305.
item_list
kind(task,memory,page,proposal),query,filterobject per kind,sort,limit,cursor; response withtotal,hasMore,nextCursor.- Tasks are the active ones (open, in_progress, blocked) unless
includeClosed; nostatusfilter (#311). - Filters per kind: task
priority,assignee,parent,includeClosed; memorytype,tags,visibility,includeArchived,includeExpired; pageparent,includeArchived; proposalstate,author,targetKind.
Done (113f523)
src/Conderis/Services/Items: ItemReadTools (not registered as MCP tools until #317), IItemHistory with RevisionItemHistory, TextPart, ItemPage; McpJson.Node removes nulls from hand-built JSON but keeps a proposal's changes and current untouched. Tests in ItemReadToolsTests; BuiltV2ToolsMatchTheMeasuredSchemas fails if a shipped description drifts from the one measured in #311.
Decisions taken while building:
- Version until #320: for memories, pages and instructions
versionis the position of the published revision (1, 2, 3 …), found by following each revision's base revision because creation times can be equal. Moves and archiving change no version, as decision 7 of #309 wants. Tasks keep their version column. #315 maps a writtenversionto the matching revision the same way. - Earlier task versions are not rebuilt:
versionon a task is refused with a pointer tohistory=true, whose entries carry each field's old and new value. #320 stores full states and lifts this. - Paging runs over the complete, deterministically ordered list in the tool;
KnowledgeService.Listgot alimitparameter andProposalServiceaCountPublicfor this. Cursors are bound to caller, kind, project, query, filter and sort; a cursor from another list is refused. - Partial reads cut at the last line break before
takeand never inside a surrogate pair; a partial answer carriescontentLength,offset,nextOffset,complete: falseand the Markdown outline (headings inside code fences excluded). - Pages are listed in tree order;
sortis refused for them, andqueryfor proposals.
Open for later subtasks: page history names human authors by email, as item_history does today; hiding that belongs with #316's rule of no email addresses in responses. The old read tools and their tests stay until #317 removes them.