Skip to content

feat(history): bind scoped MCP sessions to timestamped history - #720

Merged
JSv4 merged 1 commit into
mainfrom
feat/history-mcp-binding
Sep 6, 2026
Merged

feat(history): bind scoped MCP sessions to timestamped history#720
JSv4 merged 1 commit into
mainfrom
feat/history-mcp-binding

Conversation

@JSv4

@JSv4 JSv4 commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Stack layer 16 for #671/#672, based on #719. Adds opt-in docxodus_history on the existing MCP session/dispatch path; no new transport, timer, service, or subscription. Hosts configure an absolute DOCXODUS_HISTORY_ROOT; tool callers cannot override storage or document identity. Identity is the session's canonical scoped opening location, including across save-as.

Supports read/updates/create/list/get/export/materialize/replay/time lookup/restore through the shared facade, plus sequence- or timestamp-selected HTML rendering through the existing converter. Create captures clean session bytes without writing the source. Restore appends history only, preserving open local work and the source file. Exact-head CAS, strict bounded metadata, lossless Int64 strings, foreign-version checks, and immutable file storage remain core-owned.

Validation: 206 focused .NET history/replay/MCP tests pass, including five new MCP history tests for full action parity, timestamp rendering, ordered tails, reopen, stale publication, restore non-mutation, capability/root/identity refusals, malformed inputs, and a binary checkpoint above the metadata request limit. Existing MCP acceptance smoke passes all 79 calls and 235 assertions with zero unexpected failures. Tool inventory/docs and git diff --check pass.

Self-review: GPT-5.6-sol reviewed the entire layer read-only; no actionable findings.

Client/log-rendering stack (merge bottom-up)

This completes the requested host-driven checkpoint-rendering/client-binding scope. Sequence orders accepted changes; timestamps select historical positions. Fine-grained keystroke recording, automatic concurrent-edit rebase, durable outbox and selective undo remain explicitly outside this implementation; this does not claim to close the broader #671/#672 roadmap.

@JSv4
JSv4 changed the base branch from feat/collaboration-live-viewer to main September 6, 2026 13:03
@JSv4
JSv4 merged commit dcb8733 into main Sep 6, 2026
9 checks passed
JSv4 pushed a commit that referenced this pull request Sep 6, 2026
The second batch of the stack rippled History outward: sequence replay and
timestamp lookup in the core, a HistoryClientOps facade, then the bridges and
clients — wasm/DocxodusWasm/HistoryBridge.cs, npm/src/history.ts, the python-host
bindings, docx_scalpel/history.py, and a new history tool in the MCP server.
Rebuild-yes, re-measure-no, and a clean auto-merge with no CHANGELOG in the range.

The risk worth naming: tools/mcp-server/ToolCatalog.cs gained 58 lines. This
demo's redline-theater.test.mjs parses that file and fails if any (tool, action)
pair, search mode, set_mode value or argument the script puts on the wire is
missing from the real catalog — so a catalog edit is the one upstream change that
can break the demo's central claim without touching a line of demo code. Ran that
check first, before the rebuild, because it needs no build to answer: 45/45. The
new history tool is purely additive; nothing the script calls was renamed or
removed.

Rebuilt because npm/src/embed.ts, index.ts and types.ts all changed and a new
history.ts joined them, all bundled into the embed bundle this demo loads.

Not re-measured. The edits to files outside History are wiring — one line in the
MCP dispatcher, three in its Program, five in SessionStore — and nothing in the
range touches DocxDiff, the session save path or the HTML converter behaviourally.

Verified: 61 node checks, 3 pin checks, 14 browser assertions.
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