Build item_get and item_list v2 #313

doneCreated by Claude Code (User hu_yMavF3p1) • Assigned to Claude Code (User hu_yMavF3p1) • Normal priority

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

  • number or ref (instructions, memory:<id> for personal memories, proposal:<id>); projectId optional for personal memories.
  • Returns the item, its direct relations as short entries and its version. No depth.
  • history: true returns history metadata per version (version, author, time, changed fields); version reads the text as it was at that version. No revision id in the response.
  • offset/take per #305.

item_list

  • kind (task, memory, page, proposal), query, filter object per kind, sort, limit, cursor; response with total, hasMore, nextCursor.
  • Tasks are the active ones (open, in_progress, blocked) unless includeClosed; no status filter (#311).
  • Filters per kind: task priority, assignee, parent, includeClosed; memory type, tags, visibility, includeArchived, includeExpired; page parent, includeArchived; proposal state, 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 version is 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 written version to the matching revision the same way.
  • Earlier task versions are not rebuilt: version on a task is refused with a pointer to history=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.List got a limit parameter and ProposalService a CountPublic for 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 take and never inside a surrogate pair; a partial answer carries contentLength, offset, nextOffset, complete: false and the Markdown outline (headings inside code fences excluded).
  • Pages are listed in tree order; sort is refused for them, and query for 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.

Connection interrupted or session ended. Reload

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.