Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

docs: define doclib server identity validation

jinzhenjcadeee709929
diff --git a/docs/plans/2026-07-21-endpoint-only-discovery-design.md b/docs/plans/2026-07-21-endpoint-only-discovery-design.md
index 099a9573..824603ad 100644
--- a/docs/plans/2026-07-21-endpoint-only-discovery-design.md
+++ b/docs/plans/2026-07-21-endpoint-only-discovery-design.md
@@ -18,12 +18,27 @@ Transports recorded in a valid endpoint file remain ordered with UDS before
TCP. Explicit `socket_path` and `base_url` constructor arguments remain direct
endpoint overrides and do not read the discovery file.
-This change does not add server home validation. That is a separate follow-up
-needed to reject stale endpoint files that resolve to a live server owned by a
-different home.
+## Server identity validation
+
+Each Doclib Server process generates a random `server_id`. Endpoint version 2
+stores that identifier alongside the PID and transports, and
+`GET /server/status` returns the same value. A default-discovery client lazily
+probes each candidate transport before its first business request and only uses
+a candidate whose reported `server_id` matches the endpoint.
+
+This binds the endpoint file selected through `MINERU_HOME` to the exact server
+process that wrote it without comparing runtime-specific path strings. A stale
+endpoint whose TCP port or UDS path has been reused is rejected with
+`server_instance_mismatch`. Version 1 endpoints and malformed version 2
+endpoints are invalid and provide no connection candidates.
+
+Explicit `socket_path` and `base_url` values represent a caller-selected server
+and bypass endpoint discovery and instance validation. PID and `mineru_home`
+remain diagnostic fields and are not identity checks.
## Verification
-Unit tests cover valid endpoint ordering, missing and invalid endpoint files,
-and explicit UDS/TCP overrides. Existing doclib and CLI server tests must remain
-green.
+Unit tests cover endpoint schema round trips, valid endpoint ordering, missing
+and invalid endpoint files, explicit UDS/TCP overrides, matching identities,
+mismatched identities, and fallback to another transport after an identity
+mismatch. Existing doclib and CLI server tests must remain green.