Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
release: v0.6.13
github-actions[bot]9220205ed969
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex da97be324..bb30d1d98 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,26 @@# Changelog+## v0.6.13++- chore(main): release 0.6.13+- fix: extend tester structured generation timeouts+- fix(server): serialize async config registry updates+- fix(server): preflight profile variant config updates+- fix(server): drain removed profile variants during config apply+- fix(sie-mcp): chunk GLiNER extract/redact for large docs; flag the other 4B+- feat(sie-mcp): per-tool GPU routing and env-overridable GLiNER models+- docs(sie-mcp): add the Obsidian contract-graph example+- fix(server): tighten profile variant reconciliation+- fix(server): preserve profile variants during config reconcile+- fix(gateway): retry failed payload cleanup deletes+- fix(gateway): dedupe offloaded payload cleanup keys+- fix(gateway): track exact offloaded payload keys+- docs(sie-mcp): use the rendered Excalidraw PNG for the architecture diagram+- docs(sie-mcp): replace the ASCII architecture sketch with an Excalidraw diagram+- docs(sie-mcp): accessible README intro; drop the redundant product page+- fix(sie-mcp): bound text offload inputs+- feat(sie-mcp): integrate managed plugin skills+## v0.6.12- chore(main): release 0.6.12diff --git a/deploy/helm/sie-cluster/Chart.yaml b/deploy/helm/sie-cluster/Chart.yamlindex 10f81d156..be7f87d74 100644--- a/deploy/helm/sie-cluster/Chart.yaml+++ b/deploy/helm/sie-cluster/Chart.yaml@@ -4,8 +4,8 @@ description: >-SIE (Search Inference Engine) Kubernetes deployment with gateway, GPU workers,and observabilitytype: application-version: 0.6.12 # x-release-please-version-appVersion: v0.6.12 # x-release-please-version+version: 0.6.13 # x-release-please-version+appVersion: v0.6.13 # x-release-please-versionkeywords:- inference- embeddingdiff --git a/integrations/sie_chroma/pyproject.toml b/integrations/sie_chroma/pyproject.tomlindex 59b7a5045..c5eb0652e 100644--- a/integrations/sie_chroma/pyproject.toml+++ b/integrations/sie_chroma/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-chroma"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for ChromaDB"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_crewai/pyproject.toml b/integrations/sie_crewai/pyproject.tomlindex 2dc18eae1..58f3e136c 100644--- a/integrations/sie_crewai/pyproject.toml+++ b/integrations/sie_crewai/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-crewai"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for CrewAI"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_dspy/pyproject.toml b/integrations/sie_dspy/pyproject.tomlindex e97c266b6..83474fbad 100644--- a/integrations/sie_dspy/pyproject.toml+++ b/integrations/sie_dspy/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-dspy"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for DSPy"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_haystack/pyproject.toml b/integrations/sie_haystack/pyproject.tomlindex 6a8528cc3..b21009fd3 100644--- a/integrations/sie_haystack/pyproject.toml+++ b/integrations/sie_haystack/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-haystack"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for Haystack"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_lancedb/pyproject.toml b/integrations/sie_lancedb/pyproject.tomlindex 46124894f..a6c0a2410 100644--- a/integrations/sie_lancedb/pyproject.toml+++ b/integrations/sie_lancedb/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-lancedb"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for LanceDB"requires-python = ">=3.12"dependencies = [diff --git a/integrations/sie_langchain/pyproject.toml b/integrations/sie_langchain/pyproject.tomlindex 41d1398d8..19966702f 100644--- a/integrations/sie_langchain/pyproject.toml+++ b/integrations/sie_langchain/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-langchain"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for LangChain"requires-python = ">=3.10"dependencies = [diff --git a/integrations/sie_llamaindex/pyproject.toml b/integrations/sie_llamaindex/pyproject.tomlindex 3766358f2..6741331bc 100644--- a/integrations/sie_llamaindex/pyproject.toml+++ b/integrations/sie_llamaindex/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-llamaindex"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for LlamaIndex"requires-python = ">=3.10"dependencies = [diff --git a/integrations/sie_qdrant/pyproject.toml b/integrations/sie_qdrant/pyproject.tomlindex 423dc981c..6cee5af19 100644--- a/integrations/sie_qdrant/pyproject.toml+++ b/integrations/sie_qdrant/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-qdrant"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for Qdrant"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_ts_chroma/package.json b/integrations/sie_ts_chroma/package.jsonindex e36987919..58162a200 100644--- a/integrations/sie_ts_chroma/package.json+++ b/integrations/sie_ts_chroma/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-chroma",- "version": "0.6.12",+ "version": "0.6.13","description": "SIE embedding function for ChromaDB","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_lancedb/package.json b/integrations/sie_ts_lancedb/package.jsonindex 140bf94f1..5ed0640ab 100644--- a/integrations/sie_ts_lancedb/package.json+++ b/integrations/sie_ts_lancedb/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-lancedb",- "version": "0.6.12",+ "version": "0.6.13","description": "SIE embedding function and reranker for LanceDB","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_langchain/package.json b/integrations/sie_ts_langchain/package.jsonindex 772397a57..8af0dbf78 100644--- a/integrations/sie_ts_langchain/package.json+++ b/integrations/sie_ts_langchain/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-langchain",- "version": "0.6.12",+ "version": "0.6.13","description": "SIE embeddings integration for LangChain.js","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_llamaindex/package.json b/integrations/sie_ts_llamaindex/package.jsonindex 153b679a7..3d4e28497 100644--- a/integrations/sie_ts_llamaindex/package.json+++ b/integrations/sie_ts_llamaindex/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-llamaindex",- "version": "0.6.12",+ "version": "0.6.13","description": "SIE embeddings integration for LlamaIndex.TS","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_weaviate/pyproject.toml b/integrations/sie_weaviate/pyproject.tomlindex da62bf023..c7a0d7792 100644--- a/integrations/sie_weaviate/pyproject.toml+++ b/integrations/sie_weaviate/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-weaviate"-version = "0.6.12"+version = "0.6.13"description = "SIE integration for Weaviate"readme = "README.md"requires-python = ">=3.10"diff --git a/packages/sie_gateway/Cargo.lock b/packages/sie_gateway/Cargo.lockindex 25c1281b5..f1ed34fc6 100644--- a/packages/sie_gateway/Cargo.lock+++ b/packages/sie_gateway/Cargo.lock@@ -2960,7 +2960,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "sie-gateway"-version = "0.6.12"+version = "0.6.13"dependencies = ["arc-swap","async-nats",diff --git a/packages/sie_gateway/Cargo.toml b/packages/sie_gateway/Cargo.tomlindex 99c830437..786ac8a56 100644--- a/packages/sie_gateway/Cargo.toml+++ b/packages/sie_gateway/Cargo.toml@@ -1,6 +1,6 @@[package]name = "sie-gateway"-version = "0.6.12"+version = "0.6.13"edition = "2021"publish = falsediff --git a/packages/sie_gateway/openapi.json b/packages/sie_gateway/openapi.jsonindex dc0958d27..de2680860 100644--- a/packages/sie_gateway/openapi.json+++ b/packages/sie_gateway/openapi.json@@ -2997,7 +2997,7 @@"url": "https://www.apache.org/licenses/LICENSE-2.0.html"},"title": "SIE Gateway",- "version": "0.6.12"+ "version": "0.6.13"},"openapi": "3.1.0","paths": {diff --git a/packages/sie_gateway/src/queue/publisher.rs b/packages/sie_gateway/src/queue/publisher.rsindex adc39c5a4..113496760 100644--- a/packages/sie_gateway/src/queue/publisher.rs+++ b/packages/sie_gateway/src/queue/publisher.rs@@ -1,4 +1,4 @@-use std::collections::BTreeMap;+use std::collections::{BTreeMap, BTreeSet};use std::sync::Arc;use std::time::{Duration, Instant};@@ -636,12 +636,12 @@ pub struct WorkPublisher {/// for failure/timeout terminations, reconciled against ``pending_streams``/// by the periodic ``cleanup_expired`` sweep.offloaded_streams: DashSet<String>,- /// Request ids that offloaded at least one ``encode``/``score`` payload to- /// the object store (item ``{id}_{i}.bin`` or query ``{id}_score.bin``).- /// Lets [`Self::cleanup_offloaded_payloads`] no-op for the common all-inline- /// case, so completing a small request issues zero object-store DELETEs- /// (issue #1471).- offloaded_payloads: DashSet<String>,+ /// Object-store payload keys written or attempted for non-streaming+ /// requests. Keyed by request id so cleanup deletes only concrete keys+ /// instead of deriving every possible ``{id}_{i}.bin`` / ``{id}_score.bin``+ /// name from ``total_items``. Failed deletes stay tracked so+ /// ``cleanup_expired`` can retry them after the request collector is gone.+ offloaded_payload_keys: DashMap<String, BTreeSet<String>>,/// Core NATS client (cancel publishes use core NATS, not/// JetStream). Populated lazily by/// :meth:`start_inbox_subscription`; reads on the cancel path@@ -1225,7 +1225,7 @@ impl WorkPublisher {pending_results: DashMap::new(),pending_streams: DashMap::new(),offloaded_streams: DashSet::new(),- offloaded_payloads: DashSet::new(),+ offloaded_payload_keys: DashMap::new(),nats_client: tokio::sync::RwLock::new(None),inbox_handle: tokio::sync::Mutex::new(None),fallback_buckets: DashMap::new(),@@ -1595,8 +1595,7 @@ impl WorkPublisher {}Err(fallback_err) => {self.pending_results.remove(&request_id);- self.cleanup_offloaded_payloads(&request_id, total_items)- .await;+ self.cleanup_offloaded_payloads(&request_id).await;return Err(format!("{}; pool fallback publish failed: {}",e, fallback_err@@ -1605,8 +1604,7 @@ impl WorkPublisher {}} else {self.pending_results.remove(&request_id);- self.cleanup_offloaded_payloads(&request_id, total_items)- .await;+ self.cleanup_offloaded_payloads(&request_id).await;return Err(e);}}@@ -1892,8 +1890,7 @@ impl WorkPublisher {// Track before the store write (issue #1471 review): a future dropped// mid-`put` may still have landed the blob, so it must stay eligible// for cleanup.- self.offloaded_payloads- .insert(shared.request_id.to_string());+ record_offloaded_payload_key(&self.offloaded_payload_keys, shared.request_id, &ref_key);if let Err(e) = self.payload_store.put(&ref_key, &score_payload).await {warn!(error = %e, "failed to offload score payload, sending inline");} else {@@ -2588,8 +2585,11 @@ impl WorkPublisher {// `try_join_all`, yet the object-store write may still have landed.// Recording the id first keeps the blob eligible for cleanup on the// error/timeout unwind (issue #1471 review).- self.offloaded_payloads- .insert(shared.request_id.to_string());+ record_offloaded_payload_key(+ &self.offloaded_payload_keys,+ shared.request_id,+ &offload_key,+ );if let Err(e) = self.payload_store.put(&offload_key, &item_msgpack).await {warn!(error = %e, "failed to offload payload, sending inline");} else {@@ -2634,7 +2634,6 @@ impl WorkPublisher {if all_done {// Remove atomically — only one thread can win this removeif let Some((_, mut collector)) = self.pending_results.remove(&request_id) {- let total = collector.results.len() as u32;let operation = collector.operation.clone();let wait_secs = collector.published_at.elapsed().as_secs_f64();let results: Vec<WorkResult> =@@ -2648,7 +2647,7 @@ impl WorkPublisher {.with_label_values(&[&operation]).observe(wait_secs);- self.cleanup_offloaded_payloads(&request_id, total).await;+ self.cleanup_offloaded_payloads(&request_id).await;}}}@@ -2973,14 +2972,26 @@ impl WorkPublisher {pub async fn cleanup_expired(&self) {let now = Instant::now();- let expired: Vec<(String, u32)> = self+ // Reconcile retained payload-delete failures for completed/failed+ // non-streaming requests. Live requests stay protected by their+ // ``pending_results`` entry; once that entry is gone, only the exact+ // recorded object-store keys are retried.+ let orphaned_payloads = collect_orphaned_offloaded_payload_requests(+ &self.offloaded_payload_keys,+ |request_id| self.pending_results.contains_key(request_id),+ );+ for request_id in orphaned_payloads {+ self.cleanup_offloaded_payloads(&request_id).await;+ }++ let expired: Vec<String> = self.pending_results.iter().filter(|entry| now > entry.value().deadline)- .map(|entry| (entry.key().clone(), entry.value().results.len() as u32))+ .map(|entry| entry.key().clone()).collect();- for (key, total) in &expired {+ for key in &expired {if let Some((_, mut collector)) = self.pending_results.remove(key) {warn!(request_id = %key, "result collector timed out");let results: Vec<WorkResult> = collector.results.drain(..).flatten().collect();@@ -2993,7 +3004,7 @@ impl WorkPublisher {}}}- self.cleanup_offloaded_payloads(key, *total).await;+ self.cleanup_offloaded_payloads(key).await;}// Reconcile offloaded generate blobs: any tracked request whose stream@@ -3094,48 +3105,72 @@ impl WorkPublisher {}/// Remove offloaded payloads for a completed/expired request. No-op when the- /// request offloaded nothing (every item was inline) — otherwise this issued- /// an object-store DELETE per item index plus a score key on *every* request,- /// i.e. wasted network round-trips for keys that were never written, which- /// serialized the inbox handler and capped throughput (issue #1471).- async fn cleanup_offloaded_payloads(&self, request_id: &str, total_items: u32) {+ /// request offloaded nothing, and exact-key cleanup for mixed requests that+ /// offloaded only a subset of possible payload blobs.+ async fn cleanup_offloaded_payloads(&self, request_id: &str) {cleanup_offloaded_payloads_inner(self.payload_store.as_ref(),- &self.offloaded_payloads,+ &self.offloaded_payload_keys,request_id,- total_items,).await;}}-/// Delete the object-store blobs an offloaded request wrote (``{id}_{i}.bin``-/// per item + ``{id}_score.bin``) and drop its tracking entry. **No-op when the-/// request offloaded nothing** (`offloaded` does not contain it) — the common-/// all-inline case — so it issues zero object-store DELETEs. Extracted from-/// [`WorkPublisher::cleanup_offloaded_payloads`] so the guard is unit-testable-/// without a live JetStream context (issue #1471).+fn collect_orphaned_offloaded_payload_requests(+ offloaded: &DashMap<String, BTreeSet<String>>,+ is_pending: impl Fn(&str) -> bool,+) -> Vec<String> {+ offloaded+ .iter()+ .filter(|entry| !is_pending(entry.key()))+ .map(|entry| entry.key().clone())+ .collect()+}++fn record_offloaded_payload_key(+ offloaded: &DashMap<String, BTreeSet<String>>,+ request_id: &str,+ key: &str,+) {+ offloaded+ .entry(request_id.to_string())+ .or_default()+ .insert(key.to_string());+}++/// Delete the object-store blobs an offloaded request wrote or attempted. No-op+/// when the request offloaded nothing. Successful deletes are dropped from+/// tracking; failed deletes are retained so the periodic reconcile can retry.+/// Extracted from [`WorkPublisher::cleanup_offloaded_payloads`] so the guard is+/// unit-testable without a live JetStream context (issue #1471).async fn cleanup_offloaded_payloads_inner(payload_store: &dyn PayloadStore,- offloaded: &DashSet<String>,+ offloaded: &DashMap<String, BTreeSet<String>>,request_id: &str,- total_items: u32,) {- if !offloaded.contains(request_id) {+ let Some((_, keys)) = offloaded.remove(request_id) else {return;- }- for index in 0..total_items {- let key = format!("{}_{}.bin", request_id, index);+ };++ let mut failed = BTreeSet::new();+ for key in keys {if let Err(e) = payload_store.delete(&key).await {- warn!(key = %key, error = %e, "failed to remove offloaded payload");+ warn!(+ key = %key,+ error = %e,+ "failed to remove offloaded payload; will retry on next reconcile"+ );+ failed.insert(key);}}- let score_key = format!("{}_score.bin", request_id);- if let Err(e) = payload_store.delete(&score_key).await {- warn!(key = %score_key, error = %e, "failed to remove offloaded score payload");+ if !failed.is_empty() {+ offloaded+ .entry(request_id.to_string())+ .or_default()+ .extend(failed);}- offloaded.remove(request_id);}/// Content negotiation: determine if client wants msgpack or JSON.@@ -3197,13 +3232,13 @@ mod tests {}// Common case (issue #1471): a small/inline request that never offloaded a- // payload must issue ZERO object-store DELETEs — the unconditional+ // payload must issue zero object-store DELETEs. The unconditional// per-request DELETE storm is exactly what capped throughput.#[tokio::test]async fn cleanup_offloaded_payloads_noop_when_nothing_offloaded() {let store = CountingPayloadStore::default();- let offloaded: DashSet<String> = DashSet::new(); // request NOT tracked- cleanup_offloaded_payloads_inner(&store, &offloaded, "req-inline", 4).await;+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-inline").await;let deleted = store.deleted.lock().unwrap();assert!(deleted.is_empty(),@@ -3212,58 +3247,72 @@ mod tests {);}- // A request that actually offloaded gets its blobs deleted (one per item- // index + the score key) and is dropped from the tracking set.+ #[test]+ fn orphaned_offloaded_payload_requests_skip_live_pending_results() {+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ record_offloaded_payload_key(&offloaded, "req-done", "req-done_0.bin");+ record_offloaded_payload_key(&offloaded, "req-live", "req-live_0.bin");+ let got = collect_orphaned_offloaded_payload_requests(&offloaded, |request_id| {+ request_id == "req-live"+ });+ assert_eq!(+ got,+ vec!["req-done".to_string()],+ "reconcile must retry only tracked payloads whose request is no longer pending",+ );+ }++ // A request that actually offloaded deletes only the concrete keys that+ // were recorded. This keeps mixed batches from deleting every possible+ // `{id}_{i}.bin` sibling just because one item crossed the threshold.#[tokio::test]- async fn cleanup_offloaded_payloads_deletes_when_offloaded() {+ async fn cleanup_offloaded_payloads_deletes_only_tracked_keys() {let store = CountingPayloadStore::default();- let offloaded: DashSet<String> = DashSet::new();- offloaded.insert("req-big".to_string());- cleanup_offloaded_payloads_inner(&store, &offloaded, "req-big", 2).await;+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ record_offloaded_payload_key(&offloaded, "req-big", "req-big_1.bin");+ record_offloaded_payload_key(&offloaded, "req-big", "req-big_score.bin");+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-big").await;let mut got = store.deleted.lock().unwrap().clone();got.sort();assert_eq!(got,- vec![- "req-big_0.bin".to_string(),- "req-big_1.bin".to_string(),- "req-big_score.bin".to_string(),- ],- "offloaded request must delete each item blob + the score key",+ vec!["req-big_1.bin".to_string(), "req-big_score.bin".to_string(),],+ "cleanup must delete only the keys that were actually recorded",);assert!(- !offloaded.contains("req-big"),+ !offloaded.contains_key("req-big"),"tracking entry must be dropped after cleanup",);}- // A tracked request with zero items deletes ONLY the score key (no item- // blobs): pins the loop bound + the always-issued score delete.+ // A score request records only the score blob, so cleanup must not infer an+ // item blob from the request id.#[tokio::test]- async fn cleanup_offloaded_payloads_total_items_zero_deletes_only_score() {+ async fn cleanup_offloaded_payloads_score_key_only_when_tracked() {let store = CountingPayloadStore::default();- let offloaded: DashSet<String> = DashSet::new();- offloaded.insert("req-score".to_string());- cleanup_offloaded_payloads_inner(&store, &offloaded, "req-score", 0).await;+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ record_offloaded_payload_key(&offloaded, "req-score", "req-score_score.bin");+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-score").await;let got = store.deleted.lock().unwrap().clone();assert_eq!(got,vec!["req-score_score.bin".to_string()],- "total_items=0 must delete only the score key, no item blobs",+ "score cleanup must delete only the tracked score key",);- assert!(!offloaded.contains("req-score"));+ assert!(!offloaded.contains_key("req-score"));}- // Cleanup is idempotent: a second call (both terminal cleanup paths can- // fire) is a no-op once the first dropped the tracking entry.+ // Cleanup is idempotent after a successful cleanup: a second call (both+ // terminal cleanup paths can fire) is a no-op once the first dropped the+ // tracking entry.#[tokio::test]async fn cleanup_offloaded_payloads_second_call_is_noop() {let store = CountingPayloadStore::default();- let offloaded: DashSet<String> = DashSet::new();- offloaded.insert("req-twice".to_string());- cleanup_offloaded_payloads_inner(&store, &offloaded, "req-twice", 1).await;+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ record_offloaded_payload_key(&offloaded, "req-twice", "req-twice_0.bin");+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-twice").await;let after_first = store.deleted.lock().unwrap().len();- cleanup_offloaded_payloads_inner(&store, &offloaded, "req-twice", 1).await;+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-twice").await;let after_second = store.deleted.lock().unwrap().len();assert_eq!(after_first, after_second,@@ -3271,31 +3320,71 @@ mod tests {);}- // A failing object store must not break cleanup: every delete is still- // attempted (errors are logged best-effort). NOTE: a transient delete- // failure currently drops the tracking entry without retry, so the blob- // leaks — retain-on-failure + a reconcile sweep (mirroring- // cleanup_offloaded_generate) is the #1471 follow-up.+ // Direct-publish fallback can attempt the same offload key more than once+ // for the same request. Track unique keys so cleanup remains O(unique+ // object keys), not O(publish attempts).+ #[tokio::test]+ async fn cleanup_offloaded_payloads_deduplicates_republish_keys() {+ let store = CountingPayloadStore::default();+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ record_offloaded_payload_key(&offloaded, "req-retry", "req-retry_0.bin");+ record_offloaded_payload_key(&offloaded, "req-retry", "req-retry_0.bin");+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-retry").await;+ let got = store.deleted.lock().unwrap().clone();+ assert_eq!(+ got,+ vec!["req-retry_0.bin".to_string()],+ "duplicate key records must produce one payload-store delete",+ );+ }++ // A failing object store must not break cleanup: every delete is attempted,+ // failed keys remain tracked, and a later successful pass drains them.#[tokio::test]- async fn cleanup_offloaded_payloads_best_effort_on_delete_failure() {+ async fn cleanup_offloaded_payloads_retains_failed_deletes_for_retry() {let store = CountingPayloadStore {fail_delete: true,..Default::default()};- let offloaded: DashSet<String> = DashSet::new();- offloaded.insert("req-fail".to_string());- cleanup_offloaded_payloads_inner(&store, &offloaded, "req-fail", 2).await;+ let offloaded: DashMap<String, BTreeSet<String>> = DashMap::new();+ record_offloaded_payload_key(&offloaded, "req-fail", "req-fail_1.bin");+ record_offloaded_payload_key(&offloaded, "req-fail", "req-fail_score.bin");+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-fail").await;let mut attempted = store.deleted.lock().unwrap().clone();attempted.sort();assert_eq!(attempted,vec![- "req-fail_0.bin".to_string(),"req-fail_1.bin".to_string(),"req-fail_score.bin".to_string(),],"all deletes must be attempted even when the store errors",);+ {+ let retained = offloaded.get("req-fail").expect("failed keys retained");+ assert_eq!(+ retained.iter().cloned().collect::<Vec<_>>(),+ vec![+ "req-fail_1.bin".to_string(),+ "req-fail_score.bin".to_string(),+ ],+ "failed delete keys must remain eligible for retry",+ );+ }++ let retry_store = CountingPayloadStore::default();+ cleanup_offloaded_payloads_inner(&retry_store, &offloaded, "req-fail").await;+ let mut retry_attempted = retry_store.deleted.lock().unwrap().clone();+ retry_attempted.sort();+ assert_eq!(+ retry_attempted,+ vec![+ "req-fail_1.bin".to_string(),+ "req-fail_score.bin".to_string(),+ ],+ "retry cleanup must attempt retained keys",+ );+ assert!(!offloaded.contains_key("req-fail"));}#[derive(Debug, Clone, Serialize, Deserialize)]diff --git a/packages/sie_mcp/README.md b/packages/sie_mcp/README.mdnew file mode 100644index 000000000..d41b5a742--- /dev/null+++ b/packages/sie_mcp/README.md@@ -0,0 +1,377 @@+# sie-mcp: the SIE MCP edge++Run SIE's document jobs as an MCP server **in your own cloud**. Any Claude surface+(Claude Code, the desktop app, claude.ai, Cowork) connects to it and offloads heavy,+private document work to open models on your GPUs, then works from the small artifact it+gets back. The raw bytes and any PII reach your edge, never the model API.++`sie-mcp` is a lightweight `sie_sdk` client: no GPU and no model weights. It holds one+cluster credential, exposes the document tools below over streamable-HTTP MCP, and+authenticates clients with a connector secret.++++> Editable source: [`docs/architecture.excalidraw`](docs/architecture.excalidraw), open at [excalidraw.com](https://excalidraw.com) or the VS Code / Obsidian Excalidraw plugin.++The package is two things:++- **The server** you deploy: `sie-mcp serve`.+- **The install-pack generator** users run to connect: `sie-mcp plugin-pack`. It packages the+ document skills (parse, summarize, entity extraction, PII redaction) as MCP-backed Claude+ Code and claude.ai install assets, so users process large documents without reading the+ source files into agent context.++New here? Jump to [Try it in two minutes](#quick-install-for-an-existing-hosted-edge).++## What It Exposes++The MCP server exposes these tools:++- `docs_to_markdown`: convert PDF, scans, images of pages, Office files, or HTML+ to markdown.+- `summarize_document`: summarize a document or text input through the cluster.+- `extract_entities`: extract zero-shot entity labels such as person,+ organization, date, or amount.+- `redact_pii`: return redacted text and redaction counts.+- `answer_questions`: answer questions grounded in supplied document text.+- `describe_image`: caption and classify an image.+- `extract_structured`: extract schema-valid JSON from document text.+- `generate_structured`: generate constrained JSON, regex, or grammar output.++The generated Claude Code skill pack includes:++- `superlinked-docs`: general document offload skill.+- `parse-document`: calls `docs_to_markdown`.+- `summarize-document`: calls `summarize_document`.+- `extract-entities`: calls `extract_entities`.+- `redact-pii`: calls `redact_pii`.++The redaction MCP tool intentionally does not return a placeholder-to-original+map. That keeps original PII from being handed back to the calling model. Use the+older local `sie_tools` redaction flow from PR #1336 if a de-redaction map is+required.++## Credentials Model++There are two different credentials:++- Server operator credential: `SIE_API_KEY`, used by the MCP edge to call the SIE+ cluster gateway. Only the edge process should have this.+- Connector credential: `SIE_MCP_CONNECTOR_SECRETS`, used by users or agent+ surfaces to authenticate to `/mcp`. Give users this connector secret, not the+ cluster API key.++The edge also needs `SIE_BASE_URL`, the gateway URL for the SIE cluster. For an+in-cluster Helm deployment this can be left unset and the chart points at the+gateway service.++## Quick Install For An Existing Hosted Edge++Use this when an operator has already given you:++- An MCP URL such as `https://<mcp-host>/mcp`.+- A connector secret.++From the repo root:++```bash+export SIE_MCP_URL="https://<mcp-host>/mcp"+export SIE_MCP_CONNECTOR_SECRET="<connector-secret>"++mise run mcp-plugin-pack -- \+ --cluster-label sie-test \+ --mcp-url "$SIE_MCP_URL"+```++The generated pack is written to+`packages/sie_mcp/dist/superlinked-docs-plugin/` and contains:++- `INSTALL.md`: endpoint-specific install commands.+- `superlinked-docs-skill.zip`: uploadable claude.ai skill ZIP.+- `claude-code/*/SKILL.md`: Claude Code skills in local skill layout.+- `cowork/superlinked.md`: Cowork install notes, when included.++Install it into Claude Code:++```bash+cd packages/sie_mcp/dist/superlinked-docs-plugin++claude mcp add --scope user --transport http superlinked-docs \+ "$SIE_MCP_URL" \+ --header "Authorization: Bearer $SIE_MCP_CONNECTOR_SECRET"++mkdir -p ~/.claude/skills+cp -R claude-code/* ~/.claude/skills/+```++Restart Claude Code after adding the MCP server and skills.++## Generate Only The claude.ai Skill ZIP++Use the full plugin pack for normal installs. If you only need the uploadable+claude.ai skill ZIP:++```bash+mise exec -- uv run --package sie-mcp python -m sie_mcp.cli skill-zip+```++By default this writes+`packages/sie_mcp/dist/superlinked-docs-skill.zip`.++## Run A Local Edge Against A Cluster++Use this when you have a cluster gateway URL and, if required, a cluster API key.+This starts only the lightweight MCP edge locally; document processing still runs+on the configured SIE cluster.++```bash+export SIE_BASE_URL="https://<cluster-gateway>"+export SIE_API_KEY="<cluster-api-key>" # omit if the gateway has no auth+export SIE_MCP_CONNECTOR_SECRETS="local-dev-secret:local-dev"++mise run mcp-serve -- --host 127.0.0.1 --port 8088+```++In another shell, verify the server:++```bash+curl -s http://127.0.0.1:8088/healthz+curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:8088/mcp+```++Expected result:++- `/healthz` returns `{"status":"ok"}`.+- `/mcp` returns `401` without a connector secret.++## Model And GPU Selection++The skills and the calling agent are model-agnostic. Each tool picks its model+on the edge, in this order: the call's optional `model` argument (the skills do+not pass one), then the env var below, then a built-in default.++| Tool(s) | Model env var | Default |+| --- | --- | --- |+| `docs_to_markdown` | `SIE_MCP_DOCLING_MODEL`, `SIE_MCP_VLOCR_MODEL` | `docling`, MinerU2.5-Pro |+| `extract_entities` | `SIE_MCP_EXTRACT_MODEL` | `urchade/gliner_multi-v2.1` |+| `redact_pii` | `SIE_MCP_PII_MODEL` | `urchade/gliner_multi_pii-v1` |+| `describe_image` | `SIE_MCP_CAPTION_MODEL`, `SIE_MCP_EMBED_MODEL` | Florence-2, CLIP |+| `summarize_document`, `extract_structured`, `generate_structured` | `SIE_MCP_GENERATE_MODEL` | `Qwen/Qwen3.5-4B` |+| `answer_questions` | `SIE_MCP_ENCODE_MODEL`, `SIE_MCP_RERANK_MODEL`, `SIE_MCP_GENERATE_MODEL` | bge-m3, bge-reranker, the generate model |++**GPU lanes.** `SIE_MCP_GPU` sets the default lane for every tool. Each tool also+has a per-tool override that falls back to `SIE_MCP_GPU` when unset, so a+multi-lane cluster can route each tool to its own hardware (e.g. embeddings on+`l4`, generation on `rtx6000`):++| Tool(s) | GPU env var |+| --- | --- |+| `docs_to_markdown` | `SIE_MCP_DOCS_GPU` |+| `extract_entities`, `redact_pii` | `SIE_MCP_EXTRACT_GPU` |+| `summarize_document`, `extract_structured`, `generate_structured` | `SIE_MCP_GENERATE_GPU` |+| `describe_image` | `SIE_MCP_IMAGE_GPU` |+| `answer_questions` | `SIE_MCP_QA_GPU` |++Example for a cluster whose 4B generation model is pinned on `rtx6000`:++```bash+export SIE_MCP_GENERATE_MODEL="Qwen/Qwen3.5-4B" # already the default+export SIE_MCP_GENERATE_GPU="rtx6000" # route generation to its lane+export SIE_MCP_GPU="l4" # everything else on l4+```++## Smoke Test The MCP Tool Path++The repository includes a small MCP client at+`packages/sie_mcp/docs/examples/mcp_smoke.py`. It connects exactly like a+connector client: remote streamable HTTP plus an Authorization bearer secret.++List the tools:++```bash+mise exec -- uv run --package sie-mcp python packages/sie_mcp/docs/examples/mcp_smoke.py \+ --url http://127.0.0.1:8088/mcp \+ --secret local-dev-secret \+ --list+```++Convert a sample HTML document to markdown:++```bash+mise exec -- uv run --package sie-mcp python packages/sie_mcp/docs/examples/mcp_smoke.py \+ --url http://127.0.0.1:8088/mcp \+ --secret local-dev-secret \+ --file packages/sie_mcp/docs/examples/sample.html \+ --filename sample.html \+ --engine docling+```++For a quick custom document:++```bash+printf '<h1>Hello</h1><p>local smoke test</p>' > /tmp/sie-mcp-smoke.html++mise exec -- uv run --package sie-mcp python packages/sie_mcp/docs/examples/mcp_smoke.py \+ --url http://127.0.0.1:8088/mcp \+ --secret local-dev-secret \+ --file /tmp/sie-mcp-smoke.html \+ --filename smoke.html \+ --engine docling+```++The first model-backed request can be slow while the cluster loads models.++## Run The Tests++Run the package tests from the repo root:++```bash+mise exec -- uv run --package sie-mcp python -m pytest packages/sie_mcp/tests+```++For a focused check of this plugin-pack and PR #1336 integration path:++```bash+mise exec -- uv run --package sie-mcp python -m pytest \+ packages/sie_mcp/tests/test_offload.py \+ packages/sie_mcp/tests/test_plugin_pack.py \+ packages/sie_mcp/tests/test_skill_zip.py+```++Useful lightweight checks:++```bash+bash -n tools/mise_tasks/mcp-plugin-pack.bash+git diff --check+```++## Generate A Plugin Pack For The Local Edge++Once the local edge is running, generate an install pack that points at it:++```bash+SIE_MCP_CONNECTOR_SECRET=local-dev-secret mise run mcp-plugin-pack -- \+ --cluster-label local-dev \+ --mcp-url http://127.0.0.1:8088/mcp \+ --out-dir /tmp/sie-mcp-plugin-pack+```++Then follow `/tmp/sie-mcp-plugin-pack/INSTALL.md`.++## Build And Run The Docker Server++Build with the repo's Docker task:++```bash+mise run docker -- --mcp --docker-platform linux/amd64 --bake-tag local+```++Or build directly:++```bash+docker build -t sie-mcp:local -f packages/sie_mcp/Dockerfile .+```++Run the container:++```bash+docker run --rm -p 8088:8088 \+ -e SIE_BASE_URL="$SIE_BASE_URL" \+ -e SIE_API_KEY="$SIE_API_KEY" \+ -e SIE_MCP_CONNECTOR_SECRETS="local-dev-secret:local-dev" \+ sie-mcp:local+```++Then reuse the smoke-test commands above with+`http://127.0.0.1:8088/mcp`.++## Deploy With Helm++The Helm chart has an optional `mcpEdge` section. A typical hosted deployment has+one public HTTPS host for the MCP edge and a connector secret for users.++Create the connector secret:++```bash+kubectl -n sie create secret generic sie-mcp-connector-secrets \+ --from-literal=connector-secrets="tester-secret:tester"+```++If the edge calls an external gateway that requires a cluster API key, create a+separate secret for that server-side key:++```bash+kubectl -n sie create secret generic sie-mcp-cluster-api-key \+ --from-literal=api-key="<cluster-api-key>"+```++Enable the edge:++```bash+helm upgrade sie deploy/helm/sie-cluster -n sie --reuse-values \+ --set mcpEdge.enabled=true \+ --set mcpEdge.image.repository=ghcr.io/superlinked/sie-mcp \+ --set mcpEdge.image.tag=<tag> \+ --set mcpEdge.existingSecretName=sie-mcp-connector-secrets \+ --set mcpEdge.publicUrl=https://<mcp-host> \+ --set mcpEdge.ingress.enabled=true \+ --set mcpEdge.ingress.host=<mcp-host>+```++For an external gateway instead of the in-cluster gateway, add:++```bash+--set mcpEdge.clusterBaseUrl=https://<cluster-gateway> \+--set mcpEdge.clusterApiKey.existingSecretName=sie-mcp-cluster-api-key+```++Verify:++```bash+kubectl -n sie rollout status deploy/sie-mcp --timeout=180s+curl -s https://<mcp-host>/healthz+```++Then generate a user install pack:++```bash+SIE_MCP_CONNECTOR_SECRET=tester-secret mise run mcp-plugin-pack -- \+ --cluster-label <cluster-name> \+ --mcp-url https://<mcp-host>/mcp+```++## How Users Use It In Claude Code++After installing the generated pack, users can ask Claude Code to process files+without reading the source file into context directly. Examples:++```text+Parse ./contracts/vendor-agreement.pdf.+Summarize ./reports/quarterly-board-pack.pdf.+Extract person, organization, date, and amount entities from ./invoices/batch.pdf.+Redact PII from ./support/customer-ticket.pdf.+```++The skill instructions tell Claude Code to:++1. Read source bytes only.+2. Base64-encode the bytes.+3. Call the connected Superlinked MCP tool.+4. Write returned artifacts under `processed/`.+5. Answer from the processed artifact instead of the original file.++## Troubleshooting++`401` from `/mcp` means the connector secret is missing or wrong. Re-run the+generated `claude mcp add ... --header "Authorization: Bearer ..."` command from+`INSTALL.md`.++`/healthz` works but tools fail usually means the edge cannot call the SIE+cluster. Check `SIE_BASE_URL`, `SIE_API_KEY`, and cluster worker availability.++The first document request can take longer than later requests because model+workers may need to start or load weights.++claude.ai custom connectors require a public HTTPS MCP URL and the OAuth bridge.+Set `SIE_MCP_PUBLIC_URL=https://<mcp-host>` for hosted deployments so OAuth+metadata contains stable public URLs.diff --git a/packages/sie_mcp/docs/architecture.excalidraw b/packages/sie_mcp/docs/architecture.excalidrawnew file mode 100644index 000000000..abc288200--- /dev/null+++ b/packages/sie_mcp/docs/architecture.excalidraw@@ -0,0 +1,525 @@+{+ "type": "excalidraw",+ "version": 2,+ "source": "https://excalidraw.com",+ "elements": [+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 1007,+ "isDeleted": false,+ "id": "client",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 150,+ "y": 60,+ "strokeColor": "#1971c2",+ "backgroundColor": "#e7f5ff",+ "width": 440,+ "height": 64,+ "seed": 1014,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "boundElements": [+ {+ "type": "text",+ "id": "client_t"+ }+ ],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1021,+ "isDeleted": false,+ "id": "client_t",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 158,+ "y": 68,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 424,+ "height": 48,+ "seed": 1028,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 1,+ "text": "Claude\nCode / desktop / claude.ai / Cowork",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "client",+ "originalText": "Claude\nCode / desktop / claude.ai / Cowork",+ "lineHeight": 1.25+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 1035,+ "isDeleted": false,+ "id": "edge",+ "fillStyle": "solid",+ "strokeWidth": 3,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 150,+ "y": 224,+ "strokeColor": "#e8590c",+ "backgroundColor": "#fff4e6",+ "width": 440,+ "height": 80,+ "seed": 1042,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "boundElements": [+ {+ "type": "text",+ "id": "edge_t"+ }+ ],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1049,+ "isDeleted": false,+ "id": "edge_t",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 158,+ "y": 232,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 424,+ "height": 64,+ "seed": 1056,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 1,+ "text": "sie-mcp edge (this package, in your VPC)\nholds SIE_API_KEY",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "edge",+ "originalText": "sie-mcp edge (this package, in your VPC)\nholds SIE_API_KEY",+ "lineHeight": 1.25+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 1063,+ "isDeleted": false,+ "id": "gateway",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 250,+ "y": 408,+ "strokeColor": "#495057",+ "backgroundColor": "#f1f3f5",+ "width": 240,+ "height": 56,+ "seed": 1070,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "boundElements": [+ {+ "type": "text",+ "id": "gateway_t"+ }+ ],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1077,+ "isDeleted": false,+ "id": "gateway_t",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 258,+ "y": 416,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 224,+ "height": 40,+ "seed": 1084,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 1,+ "text": "SIE gateway",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "gateway",+ "originalText": "SIE gateway",+ "lineHeight": 1.25+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 1091,+ "isDeleted": false,+ "id": "workers",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 110,+ "y": 556,+ "strokeColor": "#495057",+ "backgroundColor": "#f1f3f5",+ "width": 520,+ "height": 80,+ "seed": 1098,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "boundElements": [+ {+ "type": "text",+ "id": "workers_t"+ }+ ],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1105,+ "isDeleted": false,+ "id": "workers_t",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 118,+ "y": 564,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 504,+ "height": 64,+ "seed": 1112,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 1,+ "text": "GPU workers\ndocling / VL-OCR / caption / generation / rerank",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "workers",+ "originalText": "GPU workers\ndocling / VL-OCR / caption / generation / rerank",+ "lineHeight": 1.25+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 1119,+ "isDeleted": false,+ "id": "arr_1126",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370.0,+ "y": 124,+ "strokeColor": "#495057",+ "backgroundColor": "transparent",+ "width": 0.0,+ "height": 100,+ "seed": 1133,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0.0,+ 100+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1140,+ "isDeleted": false,+ "id": "free_1147",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 386.0,+ "y": 160.0,+ "strokeColor": "#868e96",+ "backgroundColor": "transparent",+ "width": 286.0,+ "height": 32.5,+ "seed": 1154,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 1,+ "text": "MCP over streamable-HTTP\nAuthorization: Bearer <connector-secret>",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "MCP over streamable-HTTP\nAuthorization: Bearer <connector-secret>",+ "lineHeight": 1.25+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 1161,+ "isDeleted": false,+ "id": "arr_1168",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370.0,+ "y": 304,+ "strokeColor": "#495057",+ "backgroundColor": "transparent",+ "width": 0.0,+ "height": 104,+ "seed": 1175,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0.0,+ 104+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1182,+ "isDeleted": false,+ "id": "free_1189",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 386.0,+ "y": 349.0,+ "strokeColor": "#868e96",+ "backgroundColor": "transparent",+ "width": 50.050000000000004,+ "height": 16.25,+ "seed": 1196,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 1,+ "text": "sie_sdk",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "sie_sdk",+ "lineHeight": 1.25+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 1203,+ "isDeleted": false,+ "id": "arr_1210",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370.0,+ "y": 464,+ "strokeColor": "#495057",+ "backgroundColor": "transparent",+ "width": 0.0,+ "height": 92,+ "seed": 1217,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0.0,+ 92+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1224,+ "isDeleted": false,+ "id": "free_1231",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 615,+ "y": 244,+ "strokeColor": "#e8590c",+ "backgroundColor": "transparent",+ "width": 164.45000000000002,+ "height": 48.75,+ "seed": 1238,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 1,+ "text": "Raw bytes and PII reach\nyour edge, never the\nmodel API.",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Raw bytes and PII reach\nyour edge, never the\nmodel API.",+ "lineHeight": 1.25+ }+ ],+ "appState": {+ "gridSize": null,+ "viewBackgroundColor": "#ffffff"+ },+ "files": {}+}diff --git a/packages/sie_mcp/docs/architecture.png b/packages/sie_mcp/docs/architecture.pngnew file mode 100644index 000000000..3b9623ea2Binary files /dev/null and b/packages/sie_mcp/docs/architecture.png differdiff --git a/packages/sie_mcp/examples/obsidian-contract-graph/.gitignore b/packages/sie_mcp/examples/obsidian-contract-graph/.gitignorenew file mode 100644index 000000000..74fe10889--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/.gitignore@@ -0,0 +1,2 @@+.DS_Store+.obsidian/workspace.jsondiff --git a/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/app.json b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/app.jsonnew file mode 100644index 000000000..0967ef424--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/app.json@@ -0,0 +1 @@+{}diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/appearance.json b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/appearance.jsonnew file mode 100644index 000000000..0967ef424--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/appearance.json@@ -0,0 +1 @@+{}diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/core-plugins.json b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/core-plugins.jsonnew file mode 100644index 000000000..ec43a348a--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/core-plugins.json@@ -0,0 +1,33 @@+{+ "file-explorer": true,+ "global-search": true,+ "switcher": true,+ "graph": true,+ "backlink": true,+ "canvas": true,+ "outgoing-link": true,+ "tag-pane": true,+ "footnotes": false,+ "properties": true,+ "page-preview": true,+ "daily-notes": true,+ "templates": true,+ "note-composer": true,+ "command-palette": true,+ "slash-command": false,+ "editor-status": true,+ "bookmarks": true,+ "markdown-importer": false,+ "zk-prefixer": false,+ "random-note": false,+ "outline": true,+ "word-count": true,+ "slides": false,+ "audio-recorder": false,+ "workspaces": false,+ "file-recovery": true,+ "publish": false,+ "sync": true,+ "bases": true,+ "webviewer": false+}diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/graph.json b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/graph.jsonnew file mode 100644index 000000000..719841b62--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/.obsidian/graph.json@@ -0,0 +1,22 @@+{+ "collapse-filter": true,+ "search": "",+ "showTags": false,+ "showAttachments": false,+ "hideUnresolved": false,+ "showOrphans": true,+ "collapse-color-groups": true,+ "colorGroups": [],+ "collapse-display": true,+ "showArrow": false,+ "textFadeMultiplier": 0,+ "nodeSizeMultiplier": 1,+ "lineSizeMultiplier": 1,+ "collapse-forces": true,+ "centerStrength": 0.518713248970312,+ "repelStrength": 10,+ "linkStrength": 1,+ "linkDistance": 250,+ "scale": 1.9025037621441345,+ "close": false+}diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/README.md b/packages/sie_mcp/examples/obsidian-contract-graph/README.mdnew file mode 100644index 000000000..e06cf64ec--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/README.md@@ -0,0 +1,103 @@+# Example: a private contract knowledge graph (SIE MCP edge + Obsidian)++Turn a folder of messy legal documents into a private, linked Obsidian knowledge graph.+Parsing, entity extraction, and PII redaction all run on open models on your own cluster+through the SIE MCP edge, so the raw documents and the personal data never reach the model+API. The agent only ever sees small markdown.++An Obsidian vault is just a folder of markdown. Claude Code's file tools write into it; the SIE+MCP edge does the document processing. Nothing in this example modifies the `sie_mcp` package.++## What is in here++| Path | What it is |+|---|---|+| `inbox/` | Sample legal documents with synthetic PII: a master services agreement, an NDA with a contractor SSN, an invoice, and more. |+| `vault/` | An Obsidian vault that already holds a standing web of agreements across ten organizations, so the graph is large before you start. Contains `Home.md`, `NOTE-CONVENTIONS.md`, `Contracts/`, and `Entities/`. |+| `processed-fallback/` | A finished example note, so you can see the output shape without running anything. |+| `token-savings.html` | An interactive visual of the token reduction. Open it in a browser. |++## Prerequisites++- [Obsidian](https://obsidian.md) (free).+- Claude Code with the SIE MCP edge connected and the document skills installed. See the+ package README (`packages/sie_mcp/README.md`) and the `INSTALL.md` from a generated plugin+ pack for the exact `claude mcp add` command and the `cp -R claude-code/* ~/.claude/skills/`+ step.+- Launch Claude Code in this folder so it can read `inbox/` and write `vault/`.++## Setup++1. **Open the vault in Obsidian.** Open folder as vault, point it at this example's `vault/`,+ and open Graph View in a side pane. It is already a dense graph (about 33 cross-linked+ notes), so it looks substantial before you do anything.+2. **Connect the edge** with the `claude mcp add` command from your `INSTALL.md`, copy the+ skills into `~/.claude/skills/`, and restart Claude Code.++## Step 1: parse and link two documents++Ask the agent:++> Read `vault/NOTE-CONVENTIONS.md`. Then for `inbox/acme-globex-msa.html` and+> `inbox/globex-invoice.html`: use the **parse-document** skill to convert each to markdown+> without reading the raw file into your context, then use **extract-entities** to pull the+> parties, people, dates, and amounts. Create a note under `Contracts/` for each following the+> conventions, with every party and person as a `[[wikilink]]`, and create `Entities/` notes+> for the organizations and people. Do not open the source HTML directly.++What to notice:++- The parse-document receipt shows the token reduction (around 85 percent versus uploading the+ document).+- The raw HTML never entered the agent's context; it worked from the markdown the edge returned.+- Two contract notes plus entity notes appear in the vault.++## Step 2: redact PII before the model sees it++> `inbox/stardust-nda.html` contains a contractor's SSN, date of birth, and home address. Run+> the **redact-pii** skill on it first, so the personal data is replaced with placeholders on+> the cluster. Then build the `Contracts/` note from the redacted text, set `redacted: true`,+> and record the PII counts.++Open the new note. The agent's context only ever contained `[SOCIAL_SECURITY_NUMBER_1]`, never+the real number. The personal data stayed on the cluster.++## Step 3: synthesize from the small notes++> Update `Contracts.md` as a Map of Content linking all the notes grouped by status, then give+> me a one-paragraph briefing on the Acme-Globex relationship.++The agent writes the index and briefing from the small markdown notes, not the originals.++To keep the summary step on your own models too:++> Use the **summarize-document** skill on the redacted NDA note and add the summary to it.++This runs generation on an open model on your cluster.++## Step 4: explore the graph++Open Graph View. The documents are now one connected graph: `Acme Corp` at the center, linked+to `Globex Inc`, `Jane Doe`, `Stardust Analytics LLC`, and the redacted contractor, joined to+the standing vault of agreements that was already there. Open `Entities/Acme Corp.md` to see+its backlinks; open the NDA note to see `redacted: true` and the placeholders.++## How it works++- `docs_to_markdown` converts the document on the cluster (docling, with VL-OCR for scans).+- `extract_entities` and `redact_pii` run GLiNER on the cluster.+- The agent reasons over the small markdown artifacts: cheaper tokens, more context-window+ headroom, and raw bytes and PII that never leave your cloud.++## Extend it++- Drop your own PDF into `inbox/` and point the agent at it.+- Add a new entity label to the extract step.+- Wire an Obsidian Dataview query over the note frontmatter.+- Run the summary step on a different model through `SIE_MCP_GENERATE_MODEL`.++## Notes++- The vault is fully synthetic: made-up companies, people, and PII.+- The first model-backed request can take longer while the cluster loads weights; later calls+ are fast. `processed-fallback/` shows the finished output shape if you want to read ahead.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/acme-globex-msa.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/acme-globex-msa.htmlnew file mode 100644index 000000000..108e3b346--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/acme-globex-msa.html@@ -0,0 +1,23 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Master Services Agreement</title></head>+<body>+<h1>MASTER SERVICES AGREEMENT</h1>+<p>This Master Services Agreement ("Agreement") is entered into as of <strong>March 3, 2026</strong> ("Effective Date") by and between:</p>+<p><strong>Acme Corp</strong>, a Delaware corporation with offices at 42 Maple Street, Springfield, IL 62704 (EIN 12-3456789) ("Client"); and</p>+<p><strong>Globex Inc</strong>, a California corporation with offices at 1700 Innovation Drive, San Jose, CA 95110 ("Provider").</p>++<h2>1. Services and Fees</h2>+<p>Provider shall deliver the managed analytics services described in Exhibit A. Total contract value is <strong>$2,500,000</strong>, invoiced quarterly. Late payments accrue interest at 1.5% per month.</p>++<h2>2. Term and Renewal</h2>+<p>The initial term is twenty-four (24) months from the Effective Date. The Agreement renews automatically for successive twelve (12) month periods unless either party gives ninety (90) days written notice of non-renewal.</p>++<h2>3. Confidentiality</h2>+<p>Each party shall protect the other's Confidential Information and use it solely to perform under this Agreement.</p>++<h2>4. Signatories</h2>+<p>For Acme Corp: <strong>Jane Doe</strong>, Chief Financial Officer. Email: [email protected]. Direct line: +1 (555) 012-3456.</p>+<p>For Globex Inc: <strong>Robert Lang</strong>, Chief Executive Officer. Email: [email protected]. Direct line: +1 (555) 987-6543.</p>++<p>IN WITNESS WHEREOF, the parties have executed this Agreement as of the Effective Date.</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/globex-invoice.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/globex-invoice.htmlnew file mode 100644index 000000000..b826e3d57--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/globex-invoice.html@@ -0,0 +1,23 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Invoice INV-2026-0042</title></head>+<body>+<h1>INVOICE</h1>+<p><strong>Globex Inc</strong> - 1700 Innovation Drive, San Jose, CA 95110</p>+<p>Bill to: <strong>Acme Corp</strong>, 42 Maple Street, Springfield, IL 62704</p>+<p>Invoice number: <strong>INV-2026-0042</strong><br>+Issue date: April 1, 2026<br>+Due date: <strong>April 15, 2026</strong></p>++<h2>Line items</h2>+<table border="1" cellpadding="6">+<tr><th>Description</th><th>Period</th><th>Amount</th></tr>+<tr><td>Managed analytics services (Q1)</td><td>Jan-Mar 2026</td><td>$625,000</td></tr>+<tr><td>Onboarding and integration</td><td>One-time</td><td>$1,875,000</td></tr>+<tr><td><strong>Total due</strong></td><td></td><td><strong>$2,500,000</strong></td></tr>+</table>++<h2>Remittance</h2>+<p>Wire to Globex Inc, First National Bank. Account number: 0987654321. Routing number: 110000000.</p>+<p>Billing contact: <strong>Robert Lang</strong>, [email protected], +1 (555) 987-6543.</p>+<p>Reference: Master Services Agreement dated March 3, 2026.</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/globex-msa-amendment.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/globex-msa-amendment.htmlnew file mode 100644index 000000000..a0393ecb9--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/globex-msa-amendment.html@@ -0,0 +1,18 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Globex MSA Amendment 1</title></head>+<body>+<h1>AMENDMENT NO. 1 TO MASTER SERVICES AGREEMENT</h1>+<p>This Amendment is entered into as of <strong>May 10, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Globex Inc</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Globex Inc</strong>, with offices at 1700 Innovation Drive, San Jose, CA 95110.</p>+<h2>Terms</h2><ul>+<li>Change: adds a real-time analytics module to Exhibit A</li>+<li>Value: total contract value increased from $2,500,000 to $3,100,000</li>+<li>Term: the amended term runs concurrently with the original MSA</li>+<li>All other terms of the Acme-Globex MSA remain in force</li>+</ul>+<p>Total value: <strong>$3,100,000</strong>.</p>+<h2>Signatories</h2>+<p><strong>Jane Doe</strong>, Acme CFO ([email protected]).</p>+<p><strong>Robert Lang</strong>, Globex CEO ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/hooli-cloud.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/hooli-cloud.htmlnew file mode 100644index 000000000..d755847fb--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/hooli-cloud.html@@ -0,0 +1,18 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Hooli Cloud Agreement</title></head>+<body>+<h1>CLOUD SERVICES AGREEMENT</h1>+<p>This Cloud Services Agreement is entered into as of <strong>February 28, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Hooli Cloud Services</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Hooli Cloud Services</strong>, with offices at 900 Bryant Street, Palo Alto, CA 94301.</p>+<h2>Terms</h2><ul>+<li>Scope: managed Kubernetes, object storage, and GPU compute</li>+<li>Term: 12 months, with committed-use discounts</li>+<li>Fees: $540,000 per year, billed monthly on usage</li>+<li>SLA: 99.95% uptime with service credits</li>+</ul>+<p>Total value: <strong>$540,000 / year</strong>.</p>+<h2>Signatories</h2>+<p><strong>David Okoro</strong>, Acme CEO ([email protected]).</p>+<p><strong>Gavin Park</strong>, Hooli Account Director ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/initech-invoice.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/initech-invoice.htmlnew file mode 100644index 000000000..b36169496--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/initech-invoice.html@@ -0,0 +1,16 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Initech Invoice</title></head>+<body>+<h1>INVOICE INV-INI-118</h1>+<p><strong>Initech Systems</strong> - 88 Congress Avenue, Austin, TX 78701</p>+<p>Bill to: <strong>Acme Corp</strong>, 42 Maple Street, Springfield, IL 62704</p>+<p>Date: <strong>March 1, 2026</strong>. Amount: <strong>$120,000</strong>.</p>+<h2>Detail</h2><ul>+<li>Item: Initech suite license, Q1 2026</li>+<li>Amount: $120,000</li>+<li>Status: paid on 2026-03-12</li>+<li>Reference: Initech License</li>+</ul>+<h2>Signatories</h2>+<p><strong>Sarah Klein</strong>, Initech VP Sales ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/initech-license.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/initech-license.htmlnew file mode 100644index 000000000..2a4f98a02--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/initech-license.html@@ -0,0 +1,18 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Initech License</title></head>+<body>+<h1>SOFTWARE LICENSE AGREEMENT</h1>+<p>This License Agreement is entered into as of <strong>January 20, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Initech Systems</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Initech Systems</strong>, with offices at 88 Congress Avenue, Austin, TX 78701.</p>+<h2>Terms</h2><ul>+<li>Scope: enterprise license for up to 500 seats</li>+<li>Term: 12 months, auto-renewing unless cancelled with 60 days notice</li>+<li>Fees: $480,000 per year, billed annually in advance</li>+<li>Support: 24x7 with a four-hour response SLA</li>+</ul>+<p>Total value: <strong>$480,000 / year</strong>.</p>+<h2>Signatories</h2>+<p><strong>David Okoro</strong>, Acme CEO ([email protected]).</p>+<p><strong>Sarah Klein</strong>, Initech VP Sales ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/massive-dynamic-jda.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/massive-dynamic-jda.htmlnew file mode 100644index 000000000..2d6ca149f--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/massive-dynamic-jda.html@@ -0,0 +1,20 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Massive Dynamic JDA</title></head>+<body>+<h1>JOINT DEVELOPMENT AGREEMENT</h1>+<p>This Joint Development Agreement is entered into as of <strong>May 22, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Massive Dynamic LLC</strong> and <strong>Stardust Analytics LLC</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Massive Dynamic LLC</strong>, with offices at 17 Kendall Square, Cambridge, MA 02142.</p>+<p><strong>Stardust Analytics LLC</strong>, with offices at 210 Harbor Street, Boston, MA 02210.</p>+<h2>Terms</h2><ul>+<li>Scope: co-develop a demand-forecasting model on shared datasets</li>+<li>Term: 12 months, renewable by mutual agreement</li>+<li>Funding: $1,200,000, split per the cost-sharing schedule</li>+<li>IP: jointly owned; each party gets a perpetual license</li>+</ul>+<p>Total value: <strong>$1,200,000</strong>.</p>+<h2>Signatories</h2>+<p><strong>Nina Castillo</strong>, Massive Dynamic CTO ([email protected]).</p>+<p><strong>Maria Chen</strong>, Stardust Managing Partner ([email protected]).</p>+<p><strong>Priya Nair</strong>, Acme General Counsel ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/omar-haddad-employment.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/omar-haddad-employment.htmlnew file mode 100644index 000000000..18d7710b0--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/omar-haddad-employment.html@@ -0,0 +1,25 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Omar Haddad Employment</title></head>+<body>+<h1>EMPLOYMENT AGREEMENT</h1>+<p>This Employment Agreement is entered into as of <strong>January 6, 2026</strong> by and between <strong>Acme Corp</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<h2>Terms</h2><ul>+<li>Role: Staff Engineer, reporting to the VP of Engineering</li>+<li>Compensation: $185,000 base per year, plus equity</li>+<li>Start date: 2026-01-20</li>+<li>Personal data (SSN, date of birth, home address) redacted: see placeholders</li>+</ul>+<p>Total value: <strong>$185,000 / year</strong>.</p>+<h2>Signatories</h2>+<p><strong>David Okoro</strong>, Acme CEO ([email protected]).</p>+<h2>Employee record</h2>+<p>This record contains personal data and must be redacted before any model sees it.</p>+<ul>+<li>Name: <strong>Omar Haddad</strong></li>+<li>Email: [email protected]</li>+<li>Social Security Number: 987-65-4321</li>+<li>Date of Birth: March 4, 1991</li>+<li>Home Address: 14 Cedar Court, Springfield, IL 62704</li>+</ul>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/soylent-po.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/soylent-po.htmlnew file mode 100644index 000000000..27152ad90--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/soylent-po.html@@ -0,0 +1,17 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Soylent Foods PO</title></head>+<body>+<h1>PURCHASE ORDER PO-2026-3310</h1>+<p><strong>Soylent Foods Corp</strong> - 400 Market Street, Columbus, OH 43215</p>+<p>Bill to: <strong>Acme Corp</strong>, 42 Maple Street, Springfield, IL 62704</p>+<p>Date: <strong>June 1, 2026</strong>. Amount: <strong>$250,000</strong>.</p>+<h2>Detail</h2><ul>+<li>Item: managed analytics services, Q3 2026</li>+<li>Amount: $250,000, net 30</li>+<li>Delivery: hosted dashboards and a monthly report</li>+<li>Reference: framework terms with Acme Corp</li>+</ul>+<h2>Signatories</h2>+<p><strong>Lena Fischer</strong>, Soylent Procurement Lead ([email protected]).</p>+<p><strong>Jane Doe</strong>, Acme CFO ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/stardust-nda.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/stardust-nda.htmlnew file mode 100644index 000000000..afb7c1adb--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/stardust-nda.html@@ -0,0 +1,26 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Mutual NDA and Contractor Addendum</title></head>+<body>+<h1>MUTUAL NON-DISCLOSURE AGREEMENT</h1>+<p>This Mutual Non-Disclosure Agreement is made on <strong>February 15, 2026</strong> between <strong>Acme Corp</strong> ("Acme") and <strong>Stardust Analytics LLC</strong> ("Stardust") to protect confidential information exchanged during evaluation of a potential data partnership.</p>++<h2>1. Purpose</h2>+<p>The parties wish to explore a joint modeling initiative and will share proprietary datasets and methods under the terms below.</p>++<h2>2. Signatories</h2>+<p>For Acme Corp: <strong>Jane Doe</strong>, Chief Financial Officer ([email protected]).</p>+<p>For Stardust Analytics LLC: <strong>Maria Chen</strong>, Managing Partner ([email protected]).</p>++<h2>Exhibit B - Contractor Onboarding</h2>+<p>The following contractor is authorized to access shared materials under this NDA:</p>+<ul>+<li>Name: <strong>John Smith</strong></li>+<li>Role: Senior Data Engineer</li>+<li>Email: [email protected]</li>+<li>Phone: 555-123-4567</li>+<li>Social Security Number: 123-45-6789</li>+<li>Date of Birth: July 12, 1988</li>+<li>Home Address: 9 Birch Lane, Springfield, IL 62704</li>+</ul>+<p>This onboarding record contains personal data and must be handled in accordance with the Acme data protection policy.</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/umbrella-sow.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/umbrella-sow.htmlnew file mode 100644index 000000000..7aceb4f30--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/umbrella-sow.html@@ -0,0 +1,18 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Umbrella Logistics SOW</title></head>+<body>+<h1>STATEMENT OF WORK</h1>+<p>This Statement of Work is entered into as of <strong>February 2, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Umbrella Logistics Inc</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Umbrella Logistics Inc</strong>, with offices at 5 Dock Road, Newark, NJ 07102.</p>+<h2>Terms</h2><ul>+<li>Scope: warehousing, pick-and-pack, and last-mile delivery</li>+<li>Term: 12 months from the effective date</li>+<li>Fees: $360,000, invoiced monthly</li>+<li>SLA: 99.0% on-time delivery, measured monthly</li>+</ul>+<p>Total value: <strong>$360,000</strong>.</p>+<h2>Signatories</h2>+<p><strong>Priya Nair</strong>, Acme General Counsel ([email protected]).</p>+<p><strong>Tom Becker</strong>, Umbrella COO ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/vandelay-supply.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/vandelay-supply.htmlnew file mode 100644index 000000000..c180e9f61--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/vandelay-supply.html@@ -0,0 +1,18 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Vandelay Supply Agreement</title></head>+<body>+<h1>SUPPLY AGREEMENT</h1>+<p>This Supply Agreement is entered into as of <strong>March 18, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Vandelay Imports LLC</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Vandelay Imports LLC</strong>, with offices at 31 Industry Way, Queens, NY 11101.</p>+<h2>Terms</h2><ul>+<li>Scope: quarterly supply of edge-server hardware</li>+<li>Term: 18 months with a rolling forecast</li>+<li>Fees: $720,000 over the term, invoiced on delivery</li>+<li>Quality: 2.0% maximum defect rate, RMA within 30 days</li>+</ul>+<p>Total value: <strong>$720,000</strong>.</p>+<h2>Signatories</h2>+<p><strong>Priya Nair</strong>, Acme General Counsel ([email protected]).</p>+<p><strong>Art Vandelay</strong>, Vandelay Owner ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/inbox/wayne-series-b.html b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/wayne-series-b.htmlnew file mode 100644index 000000000..685a0f8ba--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/inbox/wayne-series-b.html@@ -0,0 +1,18 @@+<!doctype html>+<html><head><meta charset="utf-8"><title>Wayne Data Series B</title></head>+<body>+<h1>SERIES B PREFERRED STOCK PURCHASE AGREEMENT</h1>+<p>This Investment Agreement is entered into as of <strong>April 5, 2026</strong> by and between <strong>Acme Corp</strong> and <strong>Wayne Data Holdings</strong>.</p>+<p><strong>Acme Corp</strong>, with offices at 42 Maple Street, Springfield, IL 62704.</p>+<p><strong>Wayne Data Holdings</strong>, with offices at 1 Park Plaza, New York, NY 10022.</p>+<h2>Terms</h2><ul>+<li>Round: Series B preferred stock</li>+<li>Amount: $15,000,000 at a $90,000,000 pre-money valuation</li>+<li>Rights: one board seat and standard pro-rata participation</li>+<li>Close: subject to customary closing conditions</li>+</ul>+<p>Total value: <strong>$15,000,000</strong>.</p>+<h2>Signatories</h2>+<p><strong>David Okoro</strong>, Acme CEO ([email protected]).</p>+<p><strong>Bruce Wayne</strong>, Wayne Data Principal ([email protected]).</p>+</body></html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/processed-fallback/Acme-Globex MSA.md b/packages/sie_mcp/examples/obsidian-contract-graph/processed-fallback/Acme-Globex MSA.mdnew file mode 100644index 000000000..eb7522d9c--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/processed-fallback/Acme-Globex MSA.md@@ -0,0 +1,26 @@+---+title: Acme-Globex MSA+source: acme-globex-msa.html+type: contract+parties: ["[[Acme Corp]]", "[[Globex Inc]]"]+people: ["[[Jane Doe]]", "[[Robert Lang]]"]+effective_date: 2026-03-03+amount: $2,500,000+status: active+redacted: false+pii_redacted: {}+tags: [contract, msa, renewal]+---++## Summary+Master Services Agreement between [[Acme Corp]] and [[Globex Inc]], effective 2026-03-03, for managed analytics services. Total value $2,500,000, invoiced quarterly. Signed by [[Jane Doe]] (Acme CFO) and [[Robert Lang]] (Globex CEO).++## Key terms+- Term: 24 months from the effective date+- Renewal: auto-renews for successive 12-month periods; 90 days written notice to cancel+- Amount: $2,500,000, invoiced quarterly; late payments accrue 1.5% per month++## Linked entities+[[Acme Corp]] | [[Globex Inc]] | [[Jane Doe]] | [[Robert Lang]]++<!-- This is a sample of the finished output (also the live-demo fallback). The real note is generated on stage from the SIE markdown. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/token-savings.html b/packages/sie_mcp/examples/obsidian-contract-graph/token-savings.htmlnew file mode 100644index 000000000..93fb36121--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/token-savings.html@@ -0,0 +1,123 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<title>SIE Document Offload - what you just saved</title>+<style>+ :root{+ --bg:#15151c; --panel:#1f1f2b; --line:#33333f; --txt:#f2f2f5; --muted:#9a9aa7;+ --accent:#f7451d; --good:#34d399; --before:#5b5b6b;+ --font:"DM Mono",ui-monospace,SFMono-Regular,Menlo,monospace;+ }+ *{box-sizing:border-box}+ body{margin:0;background:var(--bg);color:var(--txt);font-family:var(--font);+ -webkit-font-smoothing:antialiased;line-height:1.5;padding:40px 20px;}+ .wrap{max-width:760px;margin:0 auto;}+ h1{font-size:20px;font-weight:600;margin:0 0 4px;letter-spacing:.02em;}+ .sub{color:var(--muted);font-size:13px;margin-bottom:28px;}+ .panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:22px 24px;margin-bottom:18px;}+ .controls{display:flex;flex-wrap:wrap;gap:18px;}+ .ctrl{flex:1;min-width:150px;}+ label{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:6px;}+ input[type=number],select{width:100%;background:var(--bg);color:var(--txt);border:1px solid var(--line);+ border-radius:6px;padding:8px 10px;font-family:var(--font);font-size:14px;}+ .hero{display:flex;align-items:baseline;gap:14px;margin:6px 0 18px;}+ .hero .pct{font-size:64px;font-weight:700;color:var(--good);line-height:1;}+ .hero .lab{font-size:14px;color:var(--muted);}+ .bars{margin-top:6px;}+ .barrow{margin:14px 0;}+ .barrow .top{display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px;}+ .barrow .top .n{color:var(--muted);}+ .track{height:26px;background:#000;border-radius:6px;overflow:hidden;}+ .fill{height:100%;border-radius:6px;transition:width .6s cubic-bezier(.2,.8,.2,1);}+ .fill.before{background:var(--before);}+ .fill.after{background:linear-gradient(90deg,var(--accent),#ff7a52);}+ .grid{display:flex;gap:18px;flex-wrap:wrap;margin-top:4px;}+ .stat{flex:1;min-width:150px;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:14px 16px;}+ .stat .k{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);}+ .stat .v{font-size:22px;font-weight:600;margin-top:4px;}+ .foot{color:var(--muted);font-size:12px;margin-top:8px;}+ a{color:var(--accent);}+ .tag{display:inline-block;background:#2a2a36;border:1px solid var(--line);border-radius:999px;+ padding:2px 10px;font-size:11px;color:var(--muted);margin-left:8px;vertical-align:middle;}+</style>+</head>+<body>+<div class="wrap">+ <h1>SIE Document Offload <span class="tag">what you just saved</span></h1>+ <div class="sub">Offload a document to your SIE cluster, get clean markdown back, and the model reads the small artifact instead of the whole file.</div>++ <div class="panel">+ <div class="controls">+ <div class="ctrl">+ <label>Document</label>+ <select id="ftype">+ <option value="0.829">PDF report (blended, Opus 4.8)</option>+ <option value="0.865">PDF report (blended, Sonnet 4.6)</option>+ <option value="0.633">HTML page (benchmark floor)</option>+ <option value="0.90">Scanned document</option>+ <option value="0.948">Slide deck / PPTX (benchmark ceiling)</option>+ <option value="0.85">Spreadsheet</option>+ </select>+ </div>+ <div class="ctrl">+ <label>Pages</label>+ <input id="pages" type="number" min="1" max="2000" value="40" />+ </div>+ <div class="ctrl">+ <label>Follow-up turns</label>+ <input id="turns" type="number" min="1" max="200" value="10" />+ </div>+ </div>+ </div>++ <div class="panel">+ <div class="hero"><div class="pct" id="pct">85%</div><div class="lab">fewer document tokens<br/>every turn the doc is in context</div></div>+ <div class="bars">+ <div class="barrow">+ <div class="top"><span>Upload the file to the model</span><span class="n" id="beforeN">80,000 tokens</span></div>+ <div class="track"><div class="fill before" id="beforeBar" style="width:100%"></div></div>+ </div>+ <div class="barrow">+ <div class="top"><span>Read the SIE markdown instead</span><span class="n" id="afterN">12,000 tokens</span></div>+ <div class="track"><div class="fill after" id="afterBar" style="width:15%"></div></div>+ </div>+ </div>+ </div>++ <div class="grid">+ <div class="stat"><div class="k">Saved per turn</div><div class="v" id="savedTurn">68,000</div></div>+ <div class="stat"><div class="k">Saved over session (uncached)</div><div class="v" id="savedSession">680,000</div></div>+ <div class="stat"><div class="k">Stayed in your cloud</div><div class="v">100%</div></div>+ </div>++ <div class="foot">+ Percentages are the committed token-reduction benchmark (text + one page-image per page, as a document upload is billed, vs the SIE markdown): blended 82.9% on Opus 4.8 and 86.5% on Sonnet 4.6; 63-95% across file types. Per-document token counts here are an estimate (~2,200 tokens/page: a ~1,600-token page image plus text) for illustration; the reduction percentage is measured. "Saved over the session" is the no-caching upper bound; with prompt caching the document is re-read on later turns at ~10% of input price, so the recurring saving is ~85% of that smaller cache-read cost. The reduction percentage holds either way.+ </div>+</div>++<script>+ var perPage = 2200;+ function fmt(n){ return Math.round(n).toLocaleString(); }+ function render(){+ var red = parseFloat(document.getElementById('ftype').value);+ var pages = Math.max(1, parseInt(document.getElementById('pages').value||'1',10));+ var turns = Math.max(1, parseInt(document.getElementById('turns').value||'1',10));+ var before = pages * perPage;+ var after = before * (1 - red);+ var saved = before - after;+ document.getElementById('pct').textContent = Math.round(red*100) + '%';+ document.getElementById('beforeN').textContent = fmt(before) + ' tokens';+ document.getElementById('afterN').textContent = fmt(after) + ' tokens';+ document.getElementById('afterBar').style.width = Math.max(2, (after/before)*100) + '%';+ document.getElementById('savedTurn').textContent = fmt(saved);+ document.getElementById('savedSession').textContent = fmt(saved*turns);+ }+ ['ftype','pages','turns'].forEach(function(id){+ document.getElementById(id).addEventListener('input', render);+ });+ render();+</script>+</body>+</html>diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts.mdnew file mode 100644index 000000000..5a253e040--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts.md@@ -0,0 +1,22 @@+# Contracts++Map of Content for every contract, agreement, and invoice in the vault. The three core documents (the Acme-Globex MSA, the Stardust NDA, and the Globex invoice) are added live during the demo and will appear here once processed.++## Live demo (added on stage)+- [[Acme-Globex MSA]] - master services agreement (active)+- [[Stardust NDA]] - mutual NDA with a redacted contractor record (active)+- [[Globex Invoice]] - quarterly invoice against the MSA (paid)++## Active+- [[Initech License]] - license agreement+- [[Umbrella Logistics SOW]] - statement of work+- [[Globex MSA Amendment 1]] - amendment+- [[Wayne Data Series B]] - investment agreement+- [[Vandelay Supply Agreement]] - supply agreement+- [[Hooli Cloud Agreement]] - cloud services agreement+- [[Massive Dynamic JDA]] - joint development agreement+- [[Omar Haddad Employment]] - employment agreement+- [[Soylent Foods PO]] - purchase order++## Paid / closed+- [[Initech Invoice]] - invoicediff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Globex MSA Amendment 1.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Globex MSA Amendment 1.mdnew file mode 100644index 000000000..2a2256a6a--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Globex MSA Amendment 1.md@@ -0,0 +1,31 @@+---+title: Globex MSA Amendment 1+source: globex-msa-amendment.html+type: contract+parties: ["[[Acme Corp]]", "[[Globex Inc]]"]+people: ["[[Jane Doe]]", "[[Robert Lang]]"]+effective_date: 2026-05-10+amount: $3,100,000+status: active+redacted: false+pii_redacted: {}+references: ["[[Acme-Globex MSA]]"]+tags: [contract, amendment, msa]+---++## Summary+First amendment to the [[Acme-Globex MSA]], expanding scope and raising total contract value to $3,100,000. Signed by [[Jane Doe]] and [[Robert Lang]].++## Key terms+- Change: adds a real-time analytics module to Exhibit A+- Value: total contract value increased from $2,500,000 to $3,100,000+- Term: the amended term runs concurrently with the original MSA+- All other terms of the [[Acme-Globex MSA]] remain in force++## Linked entities+[[Acme Corp]] | [[Globex Inc]] | [[Jane Doe]] | [[Robert Lang]]++## Related documents+[[Acme-Globex MSA]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Hooli Cloud Agreement.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Hooli Cloud Agreement.mdnew file mode 100644index 000000000..aa02823e6--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Hooli Cloud Agreement.md@@ -0,0 +1,27 @@+---+title: Hooli Cloud Agreement+source: hooli-cloud.html+type: contract+parties: ["[[Acme Corp]]", "[[Hooli Cloud Services]]"]+people: ["[[David Okoro]]", "[[Gavin Park]]"]+effective_date: 2026-02-28+amount: $540,000 / year+status: active+redacted: false+pii_redacted: {}+tags: [contract, cloud, infrastructure]+---++## Summary+Cloud infrastructure agreement under which [[Hooli Cloud Services]] hosts compute and storage for [[Acme Corp]], including GPU capacity. Signed by [[David Okoro]] and [[Gavin Park]].++## Key terms+- Scope: managed Kubernetes, object storage, and GPU compute+- Term: 12 months, with committed-use discounts+- Fees: $540,000 per year, billed monthly on usage+- SLA: 99.95% uptime with service credits++## Linked entities+[[Acme Corp]] | [[Hooli Cloud Services]] | [[David Okoro]] | [[Gavin Park]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Initech Invoice.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Initech Invoice.mdnew file mode 100644index 000000000..e7418c4c5--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Initech Invoice.md@@ -0,0 +1,31 @@+---+title: Initech Invoice+source: initech-invoice.html+type: invoice+parties: ["[[Initech Systems]]", "[[Acme Corp]]"]+people: ["[[Sarah Klein]]"]+effective_date: 2026-03-01+amount: $120,000+status: paid+redacted: false+pii_redacted: {}+references: ["[[Initech License]]"]+tags: [invoice, software]+---++## Summary+Quarterly invoice from [[Initech Systems]] to [[Acme Corp]] against the [[Initech License]]. Billing contact [[Sarah Klein]]. Marked paid.++## Key terms+- Item: Initech suite license, Q1 2026+- Amount: $120,000+- Status: paid on 2026-03-12+- Reference: [[Initech License]]++## Linked entities+[[Initech Systems]] | [[Acme Corp]] | [[Sarah Klein]]++## Related documents+[[Initech License]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Initech License.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Initech License.mdnew file mode 100644index 000000000..d03223673--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Initech License.md@@ -0,0 +1,27 @@+---+title: Initech License+source: initech-license.html+type: contract+parties: ["[[Acme Corp]]", "[[Initech Systems]]"]+people: ["[[David Okoro]]", "[[Sarah Klein]]"]+effective_date: 2026-01-20+amount: $480,000 / year+status: active+redacted: false+pii_redacted: {}+tags: [contract, license, software]+---++## Summary+Annual software license between [[Acme Corp]] and [[Initech Systems]] for the Initech workflow automation suite, signed by [[David Okoro]] and [[Sarah Klein]].++## Key terms+- Scope: enterprise license for up to 500 seats+- Term: 12 months, auto-renewing unless cancelled with 60 days notice+- Fees: $480,000 per year, billed annually in advance+- Support: 24x7 with a four-hour response SLA++## Linked entities+[[Acme Corp]] | [[Initech Systems]] | [[David Okoro]] | [[Sarah Klein]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Massive Dynamic JDA.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Massive Dynamic JDA.mdnew file mode 100644index 000000000..b66133e16--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Massive Dynamic JDA.md@@ -0,0 +1,27 @@+---+title: Massive Dynamic JDA+source: massive-dynamic-jda.html+type: contract+parties: ["[[Acme Corp]]", "[[Massive Dynamic LLC]]", "[[Stardust Analytics LLC]]"]+people: ["[[Nina Castillo]]", "[[Maria Chen]]", "[[Priya Nair]]"]+effective_date: 2026-05-22+amount: $1,200,000+status: active+redacted: false+pii_redacted: {}+tags: [contract, jda, research]+---++## Summary+Three-party joint development agreement among [[Acme Corp]], [[Massive Dynamic LLC]], and [[Stardust Analytics LLC]] to co-develop a forecasting model. Signed by [[Nina Castillo]], [[Maria Chen]], and [[Priya Nair]].++## Key terms+- Scope: co-develop a demand-forecasting model on shared datasets+- Term: 12 months, renewable by mutual agreement+- Funding: $1,200,000, split per the cost-sharing schedule+- IP: jointly owned; each party gets a perpetual license++## Linked entities+[[Acme Corp]] | [[Massive Dynamic LLC]] | [[Stardust Analytics LLC]] | [[Nina Castillo]] | [[Maria Chen]] | [[Priya Nair]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Omar Haddad Employment.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Omar Haddad Employment.mdnew file mode 100644index 000000000..149b78ad4--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Omar Haddad Employment.md@@ -0,0 +1,27 @@+---+title: Omar Haddad Employment+source: omar-haddad-employment.html+type: contract+parties: ["[[Acme Corp]]"]+people: ["[[David Okoro]]"]+effective_date: 2026-01-06+amount: $185,000 / year+status: active+redacted: true+pii_redacted: {person: 1, ssn: 1, date_of_birth: 1, address: 1, email: 1}+tags: [contract, employment, redacted]+---++## Summary+Employment agreement between [[Acme Corp]] and [[Omar Haddad]] for a Staff Engineer role, countersigned by [[David Okoro]]. Personal data was redacted on the SIE cluster before this note was written.++## Key terms+- Role: Staff Engineer, reporting to the VP of Engineering+- Compensation: $185,000 base per year, plus equity+- Start date: 2026-01-20+- Personal data (SSN, date of birth, home address) redacted: see placeholders++## Linked entities+[[Acme Corp]] | [[David Okoro]] | [[Omar Haddad]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Soylent Foods PO.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Soylent Foods PO.mdnew file mode 100644index 000000000..8374d2f4c--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Soylent Foods PO.md@@ -0,0 +1,27 @@+---+title: Soylent Foods PO+source: soylent-po.html+type: invoice+parties: ["[[Soylent Foods Corp]]", "[[Acme Corp]]"]+people: ["[[Lena Fischer]]", "[[Jane Doe]]"]+effective_date: 2026-06-01+amount: $250,000+status: active+redacted: false+pii_redacted: {}+tags: [invoice, po, sales]+---++## Summary+Purchase order in which [[Soylent Foods Corp]] buys a quarter of analytics services from [[Acme Corp]]. Issued by [[Lena Fischer]]; Acme contact [[Jane Doe]].++## Key terms+- Item: managed analytics services, Q3 2026+- Amount: $250,000, net 30+- Delivery: hosted dashboards and a monthly report+- Reference: framework terms with [[Acme Corp]]++## Linked entities+[[Soylent Foods Corp]] | [[Acme Corp]] | [[Lena Fischer]] | [[Jane Doe]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Umbrella Logistics SOW.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Umbrella Logistics SOW.mdnew file mode 100644index 000000000..0ffc66e18--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Umbrella Logistics SOW.md@@ -0,0 +1,27 @@+---+title: Umbrella Logistics SOW+source: umbrella-sow.html+type: contract+parties: ["[[Acme Corp]]", "[[Umbrella Logistics Inc]]"]+people: ["[[Priya Nair]]", "[[Tom Becker]]"]+effective_date: 2026-02-02+amount: $360,000+status: active+redacted: false+pii_redacted: {}+tags: [contract, sow, logistics]+---++## Summary+Statement of work under which [[Umbrella Logistics Inc]] provides fulfillment and last-mile logistics to [[Acme Corp]]. Signed by [[Priya Nair]] and [[Tom Becker]].++## Key terms+- Scope: warehousing, pick-and-pack, and last-mile delivery+- Term: 12 months from the effective date+- Fees: $360,000, invoiced monthly+- SLA: 99.0% on-time delivery, measured monthly++## Linked entities+[[Acme Corp]] | [[Umbrella Logistics Inc]] | [[Priya Nair]] | [[Tom Becker]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Vandelay Supply Agreement.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Vandelay Supply Agreement.mdnew file mode 100644index 000000000..4c5610768--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Vandelay Supply Agreement.md@@ -0,0 +1,27 @@+---+title: Vandelay Supply Agreement+source: vandelay-supply.html+type: contract+parties: ["[[Acme Corp]]", "[[Vandelay Imports LLC]]"]+people: ["[[Priya Nair]]", "[[Art Vandelay]]"]+effective_date: 2026-03-18+amount: $720,000+status: active+redacted: false+pii_redacted: {}+tags: [contract, supply, hardware]+---++## Summary+Supply agreement under which [[Vandelay Imports LLC]] provides imported hardware components to [[Acme Corp]]. Signed by [[Priya Nair]] and [[Art Vandelay]].++## Key terms+- Scope: quarterly supply of edge-server hardware+- Term: 18 months with a rolling forecast+- Fees: $720,000 over the term, invoiced on delivery+- Quality: 2.0% maximum defect rate, RMA within 30 days++## Linked entities+[[Acme Corp]] | [[Vandelay Imports LLC]] | [[Priya Nair]] | [[Art Vandelay]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Wayne Data Series B.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Wayne Data Series B.mdnew file mode 100644index 000000000..88b4e3280--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Contracts/Wayne Data Series B.md@@ -0,0 +1,27 @@+---+title: Wayne Data Series B+source: wayne-series-b.html+type: contract+parties: ["[[Acme Corp]]", "[[Wayne Data Holdings]]"]+people: ["[[David Okoro]]", "[[Bruce Wayne]]"]+effective_date: 2026-04-05+amount: $15,000,000+status: active+redacted: false+pii_redacted: {}+tags: [contract, investment, financing]+---++## Summary+Series B financing in which [[Wayne Data Holdings]] invests $15,000,000 in [[Acme Corp]]. Signed by [[David Okoro]] and [[Bruce Wayne]].++## Key terms+- Round: Series B preferred stock+- Amount: $15,000,000 at a $90,000,000 pre-money valuation+- Rights: one board seat and standard pro-rata participation+- Close: subject to customary closing conditions++## Linked entities+[[Acme Corp]] | [[Wayne Data Holdings]] | [[David Okoro]] | [[Bruce Wayne]]++<!-- Pre-populated knowledge-base note (standing vault). The three core docs (MSA, NDA, invoice) are added live on stage. -->diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Acme Corp.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Acme Corp.mdnew file mode 100644index 000000000..0323bf49a--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Acme Corp.md@@ -0,0 +1,14 @@+---+type: organization+role: Client / hub+tags: [entity, organization]+---++# Acme Corp+Delaware corporation; the account at the center of this vault.++- Role: Client / hub+- Location: 42 Maple Street, Springfield, IL 62704+- Key people: [[Jane Doe]], [[David Okoro]], [[Priya Nair]], [[Omar Haddad]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Art Vandelay.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Art Vandelay.mdnew file mode 100644index 000000000..55c5e6b56--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Art Vandelay.md@@ -0,0 +1,13 @@+---+type: person+role: Owner+tags: [entity, person]+---++# Art Vandelay+Owner at [[Vandelay Imports LLC]].++- Title: Owner+- Affiliation: [[Vandelay Imports LLC]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Bruce Wayne.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Bruce Wayne.mdnew file mode 100644index 000000000..ba62d23d3--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Bruce Wayne.md@@ -0,0 +1,13 @@+---+type: person+role: Principal+tags: [entity, person]+---++# Bruce Wayne+Principal at [[Wayne Data Holdings]].++- Title: Principal+- Affiliation: [[Wayne Data Holdings]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/David Okoro.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/David Okoro.mdnew file mode 100644index 000000000..91346e7c2--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/David Okoro.md@@ -0,0 +1,13 @@+---+type: person+role: Chief Executive Officer+tags: [entity, person]+---++# David Okoro+Chief Executive Officer at [[Acme Corp]].++- Title: Chief Executive Officer+- Affiliation: [[Acme Corp]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Gavin Park.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Gavin Park.mdnew file mode 100644index 000000000..da4c6174d--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Gavin Park.md@@ -0,0 +1,13 @@+---+type: person+role: Account Director+tags: [entity, person]+---++# Gavin Park+Account Director at [[Hooli Cloud Services]].++- Title: Account Director+- Affiliation: [[Hooli Cloud Services]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Globex Inc.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Globex Inc.mdnew file mode 100644index 000000000..f56b5235e--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Globex Inc.md@@ -0,0 +1,14 @@+---+type: organization+role: Provider+tags: [entity, organization]+---++# Globex Inc+California analytics provider under the master services agreement.++- Role: Provider+- Location: 1700 Innovation Drive, San Jose, CA 95110+- Key people: [[Robert Lang]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Hooli Cloud Services.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Hooli Cloud Services.mdnew file mode 100644index 000000000..e849ed11f--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Hooli Cloud Services.md@@ -0,0 +1,14 @@+---+type: organization+role: Cloud vendor+tags: [entity, organization]+---++# Hooli Cloud Services+Cloud infrastructure and compute provider for Acme.++- Role: Cloud vendor+- Location: 900 Bryant Street, Palo Alto, CA 94301+- Key people: [[Gavin Park]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Initech Systems.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Initech Systems.mdnew file mode 100644index 000000000..511b5ef7f--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Initech Systems.md@@ -0,0 +1,14 @@+---+type: organization+role: Software vendor+tags: [entity, organization]+---++# Initech Systems+Licenses its workflow automation suite to Acme.++- Role: Software vendor+- Location: 88 Congress Avenue, Austin, TX 78701+- Key people: [[Sarah Klein]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Jane Doe.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Jane Doe.mdnew file mode 100644index 000000000..f50247951--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Jane Doe.md@@ -0,0 +1,13 @@+---+type: person+role: Chief Financial Officer+tags: [entity, person]+---++# Jane Doe+Chief Financial Officer at [[Acme Corp]].++- Title: Chief Financial Officer+- Affiliation: [[Acme Corp]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Lena Fischer.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Lena Fischer.mdnew file mode 100644index 000000000..d8b837b00--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Lena Fischer.md@@ -0,0 +1,13 @@+---+type: person+role: Procurement Lead+tags: [entity, person]+---++# Lena Fischer+Procurement Lead at [[Soylent Foods Corp]].++- Title: Procurement Lead+- Affiliation: [[Soylent Foods Corp]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Maria Chen.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Maria Chen.mdnew file mode 100644index 000000000..0473678ca--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Maria Chen.md@@ -0,0 +1,13 @@+---+type: person+role: Managing Partner+tags: [entity, person]+---++# Maria Chen+Managing Partner at [[Stardust Analytics LLC]].++- Title: Managing Partner+- Affiliation: [[Stardust Analytics LLC]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Massive Dynamic LLC.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Massive Dynamic LLC.mdnew file mode 100644index 000000000..11c494c73--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Massive Dynamic LLC.md@@ -0,0 +1,14 @@+---+type: organization+role: R&D partner+tags: [entity, organization]+---++# Massive Dynamic LLC+Joint research and development partner with Acme and Stardust.++- Role: R&D partner+- Location: 17 Kendall Square, Cambridge, MA 02142+- Key people: [[Nina Castillo]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Nina Castillo.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Nina Castillo.mdnew file mode 100644index 000000000..e8160c296--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Nina Castillo.md@@ -0,0 +1,13 @@+---+type: person+role: Chief Technology Officer+tags: [entity, person]+---++# Nina Castillo+Chief Technology Officer at [[Massive Dynamic LLC]].++- Title: Chief Technology Officer+- Affiliation: [[Massive Dynamic LLC]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Omar Haddad.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Omar Haddad.mdnew file mode 100644index 000000000..c3242b260--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Omar Haddad.md@@ -0,0 +1,13 @@+---+type: person+role: Staff Engineer+tags: [entity, person]+---++# Omar Haddad+Staff Engineer at [[Acme Corp]].++- Title: Staff Engineer+- Affiliation: [[Acme Corp]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Priya Nair.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Priya Nair.mdnew file mode 100644index 000000000..aedb630b5--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Priya Nair.md@@ -0,0 +1,13 @@+---+type: person+role: General Counsel+tags: [entity, person]+---++# Priya Nair+General Counsel at [[Acme Corp]].++- Title: General Counsel+- Affiliation: [[Acme Corp]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Robert Lang.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Robert Lang.mdnew file mode 100644index 000000000..2ab640b6a--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Robert Lang.md@@ -0,0 +1,13 @@+---+type: person+role: Chief Executive Officer+tags: [entity, person]+---++# Robert Lang+Chief Executive Officer at [[Globex Inc]].++- Title: Chief Executive Officer+- Affiliation: [[Globex Inc]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Sarah Klein.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Sarah Klein.mdnew file mode 100644index 000000000..ac7da949c--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Sarah Klein.md@@ -0,0 +1,13 @@+---+type: person+role: VP Sales+tags: [entity, person]+---++# Sarah Klein+VP Sales at [[Initech Systems]].++- Title: VP Sales+- Affiliation: [[Initech Systems]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Soylent Foods Corp.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Soylent Foods Corp.mdnew file mode 100644index 000000000..ebcad5ef2--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Soylent Foods Corp.md@@ -0,0 +1,14 @@+---+type: organization+role: Customer+tags: [entity, organization]+---++# Soylent Foods Corp+Buys analytics services from Acme under a purchase order.++- Role: Customer+- Location: 400 Market Street, Columbus, OH 43215+- Key people: [[Lena Fischer]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Stardust Analytics LLC.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Stardust Analytics LLC.mdnew file mode 100644index 000000000..b534fc649--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Stardust Analytics LLC.md@@ -0,0 +1,14 @@+---+type: organization+role: Data partner+tags: [entity, organization]+---++# Stardust Analytics LLC+Joint-modeling and data partner evaluating initiatives with Acme.++- Role: Data partner+- Location: 210 Harbor Street, Boston, MA 02210+- Key people: [[Maria Chen]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Tom Becker.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Tom Becker.mdnew file mode 100644index 000000000..180b704e0--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Tom Becker.md@@ -0,0 +1,13 @@+---+type: person+role: Chief Operating Officer+tags: [entity, person]+---++# Tom Becker+Chief Operating Officer at [[Umbrella Logistics Inc]].++- Title: Chief Operating Officer+- Affiliation: [[Umbrella Logistics Inc]]++Backlinks below show every document this person appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Umbrella Logistics Inc.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Umbrella Logistics Inc.mdnew file mode 100644index 000000000..c6ffdd5a1--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Umbrella Logistics Inc.md@@ -0,0 +1,14 @@+---+type: organization+role: Logistics vendor+tags: [entity, organization]+---++# Umbrella Logistics Inc+Provides fulfillment and logistics under a statement of work.++- Role: Logistics vendor+- Location: 5 Dock Road, Newark, NJ 07102+- Key people: [[Tom Becker]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Vandelay Imports LLC.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Vandelay Imports LLC.mdnew file mode 100644index 000000000..84e7bed6b--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Vandelay Imports LLC.md@@ -0,0 +1,14 @@+---+type: organization+role: Supplier+tags: [entity, organization]+---++# Vandelay Imports LLC+Supplies imported hardware components to Acme.++- Role: Supplier+- Location: 31 Industry Way, Queens, NY 11101+- Key people: [[Art Vandelay]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Wayne Data Holdings.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Wayne Data Holdings.mdnew file mode 100644index 000000000..a092d4425--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Entities/Wayne Data Holdings.md@@ -0,0 +1,14 @@+---+type: organization+role: Investor+tags: [entity, organization]+---++# Wayne Data Holdings+Growth investor; led Acme's Series B financing.++- Role: Investor+- Location: 1 Park Plaza, New York, NY 10022+- Key people: [[Bruce Wayne]]++Backlinks below show every document this organization appears in.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/Home.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Home.mdnew file mode 100644index 000000000..2197fa47e--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/Home.md@@ -0,0 +1,9 @@+# Home++A private, self-hosted knowledge vault. Documents are turned into clean, linked markdown by open models on our own GPUs (via the SIE MCP edge). Raw documents and personal data never leave our infrastructure; the model only ever sees the small markdown.++- [[Contracts]] - index of every contract, agreement, NDA, and invoice+- `Entities/` - companies and people, auto-linked from the notes+- `Contracts/` - one note per document, each linking its parties and people++This vault already holds a web of standing agreements across ten organizations. Drop a document into `inbox/` and ask the agent to add it; watch it connect into the graph.diff --git a/packages/sie_mcp/examples/obsidian-contract-graph/vault/NOTE-CONVENTIONS.md b/packages/sie_mcp/examples/obsidian-contract-graph/vault/NOTE-CONVENTIONS.mdnew file mode 100644index 000000000..d1b58050e--- /dev/null+++ b/packages/sie_mcp/examples/obsidian-contract-graph/vault/NOTE-CONVENTIONS.md@@ -0,0 +1,58 @@+# Vault note conventions (read this before writing notes)++When turning an offloaded document into a vault note, follow this structure exactly so the graph and properties stay consistent.++## Where notes go+- Contract/document notes: `Contracts/<Short Title>.md`+- Entity notes (companies, people): `Entities/<Name>.md`+- Never write the raw source document into the vault. Only the SIE markdown artifact and notes derived from it.++## Document note format+Frontmatter (YAML), then a short body. Every party, person, and organization is an Obsidian wikilink `[[Name]]` so the graph connects.++```markdown+---+title: Acme-Globex MSA+source: acme-globex-msa.html+type: contract # contract | nda | invoice+parties: ["[[Acme Corp]]", "[[Globex Inc]]"]+people: ["[[Jane Doe]]", "[[Robert Lang]]"]+effective_date: 2026-03-03+amount: $2,500,000+status: active+redacted: false # true if PII was redacted before the model saw it+pii_redacted: {} # e.g. {person: 1, email: 1, ssn: 1} when redacted+tags: [contract, msa, renewal]+---++## Summary+Two or three sentences. Mention [[parties]] and [[people]] as links.++## Key terms+- Term: ...+- Renewal: ...+- Amount: [[amount]] ...++## Linked entities+[[Acme Corp]] | [[Globex Inc]] | [[Jane Doe]]+```++## Entity note format+```markdown+---+type: organization # organization | person+role: Client # for people: title; for orgs: their role+tags: [entity]+---++# Acme Corp+Brief one-line description. Backlinks below show every document this entity appears in.+```++## Redaction rule (privacy beat)+- For any document that contains personal data (SSN, home address, date of birth, personal email/phone), run SIE `redact_pii` FIRST, and build the note from the redacted text.+- In the note, set `redacted: true` and fill `pii_redacted` with the counts SIE returns.+- The redacted note keeps placeholders like `[PERSON_1]`, `[EMAIL_1]`, `[SOCIAL_SECURITY_NUMBER_1]`. The original values stay on the SIE cluster and never enter the vault or the model context.++## Index+Maintain `Contracts.md` as a Map of Content: a bullet list linking every contract note, grouped by status.diff --git a/packages/sie_mcp/plugin/SKILL.md b/packages/sie_mcp/plugin/SKILL.mdindex 849457e5b..dd7e69366 100644--- a/packages/sie_mcp/plugin/SKILL.md+++ b/packages/sie_mcp/plugin/SKILL.md@@ -46,6 +46,46 @@ estimate, not a billed figure) and `token_reduction`, the committed #1311 benchmmeasurement of markdown vs direct document ingestion. Surface these if the user asks howmuch was saved; the exact percentages and the benchmark path are in the metadata.+## summarize document++When the user asks for a summary, overview, or digest of a long document, do **not** read+the source into context. Call the `summarize_document` MCP tool instead.++- For PDF/DOCX/PPTX/XLSX/HTML/scans, read raw bytes only and pass `document_base64` plus+ `filename`.+- For text or markdown files, read raw bytes only and pass `content_base64`.+- Leave `engine` as `auto` unless the user asks to force a conversion engine.++Write the returned `summary` to a summary artifact, read that artifact, and present it.+Surface `metadata.token_savings_estimate` as an estimate when present.++## extract entities++When the user asks to list or tabulate entities, names, parties, dates, amounts, or custom+labels, call the `extract_entities` MCP tool instead of reading the whole document.++- Pick concise lowercase labels from the request, e.g. `person`, `organization`, `date`,+ `amount`, `contract term`.+- For source documents, pass `document_base64` plus `filename`.+- For text/markdown, pass `content_base64`.++Write the returned `markdown_table` to an entities artifact, then answer from the table.++## redact PII++When the user asks to redact, anonymize, scrub, or de-identify a document, call the+`redact_pii` MCP tool before working with the content.++- Do not read the source document into context before redaction.+- Pass source documents as `document_base64` plus `filename`; pass text/markdown as+ `content_base64`.+- Pass `labels` only if the user asks for a custom sensitive-data set.+- The MCP tool intentionally returns redacted text and counts, not a placeholder-to-original+ map. Do not promise de-redaction from this MCP flow.++Write `redacted_text` to a redacted artifact and continue the task using only that artifact.+Mention that detection is model-based and best-effort, not a certified scrubber.+## Structured output (schema-valid JSON / constrained generation)Two tools constrain the cluster's output at decode time, so the result is a reliable,@@ -117,7 +157,8 @@ pixels reach the calling model.## Authentication-`docs_to_markdown`, `describe_image`, `extract_structured`, and `generate_structured` are all-served by the Superlinked MCP connector. Configure the connector with your **connector-secret** — credentials are never pasted into the chat. For this POC the connector secret is-provided by your cluster operator; self-serve issuance arrives with the managed service.+`docs_to_markdown`, `summarize_document`, `extract_entities`, `redact_pii`,+`describe_image`, `extract_structured`, and `generate_structured` are all served by the+Superlinked MCP connector. Configure the connector with your **connector secret** —+credentials are never pasted into the chat. For this POC the connector secret is provided+by your cluster operator; self-serve issuance arrives with the managed service.diff --git a/packages/sie_mcp/plugin/claude-code/extract-entities/SKILL.md b/packages/sie_mcp/plugin/claude-code/extract-entities/SKILL.mdnew file mode 100644index 000000000..0356f67a7--- /dev/null+++ b/packages/sie_mcp/plugin/claude-code/extract-entities/SKILL.md@@ -0,0 +1,44 @@+---+name: extract-entities+description: Extract people, organizations, dates, amounts, or custom labels from a document through the connected Superlinked MCP edge, returning a compact table instead of reading the full document into context. Use when the user asks to list, extract, or tabulate entities from a file.+---++# Extract Entities with Superlinked MCP++Use the connected Superlinked MCP server to run zero-shot entity extraction on+the SIE cluster. This mirrors the `extract-entities` flow from the `sie_tools`+plugin in PR #1336, but uses the MCP `extract_entities` tool.++## Steps++1. Pick labels from the user's request. Lowercase nouns work best, for example:+ `person`, `organization`, `date`, `amount`, `contract term`.++2. Do not open, view, attach, or read the whole source document into context.++3. Call the Superlinked MCP `extract_entities` tool:+ - Pass `labels` as a list of label strings.+ - For PDF, scan, image-of-text, DOCX, PPTX, XLSX, or HTML inputs, read raw+ bytes only, base64-encode them, and pass `document_base64` plus `filename`.+ - For text or markdown inputs, read raw bytes only, base64-encode them, and+ pass `content_base64`.+ - Leave `engine` as `auto` unless the user explicitly asks to force a+ conversion engine.++4. Write the returned `markdown_table` to `processed/<source-stem>.entities.md`.+ Create `processed/` if it does not exist.++5. Your next message must begin with a short receipt:++ ```text+ Extracted <entity_count> entities from <source> -> processed/<source-stem>.entities.md+ ```++ Then present the entity table or the subset the user asked for.++## Errors++If the MCP call fails, relay the tool error and do not retry blindly. For auth+or connector errors, tell the user to reinstall the generated MCP plugin pack or+rerun the generated `claude mcp add ... --header 'Authorization: Bearer ...'`+command from `INSTALL.md`.diff --git a/packages/sie_mcp/plugin/claude-code/parse-document/SKILL.md b/packages/sie_mcp/plugin/claude-code/parse-document/SKILL.mdnew file mode 100644index 000000000..dffacd644--- /dev/null+++ b/packages/sie_mcp/plugin/claude-code/parse-document/SKILL.md@@ -0,0 +1,46 @@+---+name: parse-document+description: Convert a PDF, scan, image of a page, or office file to clean markdown through the connected Superlinked MCP edge, so the source document is not read into model context directly. Use when the user asks to read, parse, OCR, extract from, summarize, or answer questions about a document.+---++# Parse a Document with Superlinked MCP++Use the connected Superlinked MCP server to convert the source file to markdown,+then work from the markdown artifact. This mirrors the `parse-document` flow from+the `sie_tools` plugin in PR #1336, but uses the MCP `docs_to_markdown` tool+instead of the gateway-backed `~/.sie/bin/sie` wrapper.++## Steps++1. Do not open, view, attach, or read the source document into context. Read its+ raw bytes only and base64-encode those bytes.++2. Call the Superlinked MCP `docs_to_markdown` tool with:+ - `document_base64`: the base64-encoded source bytes+ - `filename`: the original filename+ - `engine`: `auto` unless the user explicitly asks to force `docling` or+ `vl-ocr`+ - `ocr`: leave `false` unless forcing the `docling` OCR path++3. Write the returned markdown to `processed/<source-stem>.md`. Create+ `processed/` if it does not exist.++4. Your next message must begin with a short receipt, then answer from the+ artifact selectively:++ ```text+ Parsed <source> -> processed/<source-stem>.md (<chars> chars)+ ```++ If the MCP metadata includes token-saving figures, include those figures+ directly under the receipt. Keep estimates marked as estimates.++5. Answer the user's question from the artifact. Grep or read specific sections;+ do not read the whole markdown file unless it is small.++## Errors++If the MCP call fails, relay the tool error and do not retry blindly. For auth+or connector errors, tell the user to reinstall the generated MCP plugin pack or+rerun the generated `claude mcp add ... --header 'Authorization: Bearer ...'`+command from `INSTALL.md`.diff --git a/packages/sie_mcp/plugin/claude-code/redact-pii/SKILL.md b/packages/sie_mcp/plugin/claude-code/redact-pii/SKILL.mdnew file mode 100644index 000000000..416a81766--- /dev/null+++ b/packages/sie_mcp/plugin/claude-code/redact-pii/SKILL.md@@ -0,0 +1,51 @@+---+name: redact-pii+description: Redact personal data from a document through the connected Superlinked MCP edge before working with the content. Use when the user asks to redact, anonymize, scrub, de-identify, or remove PII/sensitive data from a document.+---++# Redact PII with Superlinked MCP++Use the connected Superlinked MCP server to detect and replace PII on the SIE+cluster. This mirrors the `redact-pii` flow from the `sie_tools` plugin in+PR #1336, but uses the MCP `redact_pii` tool.++## Hard Rules++- Do not open, view, attach, or read the source document into context before+ redaction.+- After redaction, continue the user's task using only the redacted artifact.+- The MCP tool intentionally does not return a placeholder-to-original map. Do+ not promise de-redaction from the MCP flow.++## Steps++1. Call the Superlinked MCP `redact_pii` tool:+ - For PDF, scan, image-of-text, DOCX, PPTX, XLSX, or HTML inputs, read raw+ bytes only, base64-encode them, and pass `document_base64` plus `filename`.+ - For text or markdown inputs, read raw bytes only, base64-encode them, and+ pass `content_base64`.+ - Pass `labels` only if the user wants a custom PII/sensitive-data set.+ - Leave `engine` as `auto` unless the user explicitly asks to force a+ conversion engine.++2. Write the returned `redacted_text` to+ `processed/<source-stem>.redacted.md`. Create `processed/` if it does not+ exist.++3. Your next message must begin with a short receipt:++ ```text+ Redacted <span_count> spans from <source> -> processed/<source-stem>.redacted.md+ ```++ Include the label counts and the note that detection is model-based and+ best-effort, not a certified scrubber.++4. Continue the user's actual task using only the redacted artifact.++## Errors++If the MCP call fails, relay the tool error and do not retry blindly. For auth+or connector errors, tell the user to reinstall the generated MCP plugin pack or+rerun the generated `claude mcp add ... --header 'Authorization: Bearer ...'`+command from `INSTALL.md`.diff --git a/packages/sie_mcp/plugin/claude-code/summarize-document/SKILL.md b/packages/sie_mcp/plugin/claude-code/summarize-document/SKILL.mdnew file mode 100644index 000000000..c126b7e7c--- /dev/null+++ b/packages/sie_mcp/plugin/claude-code/summarize-document/SKILL.md@@ -0,0 +1,45 @@+---+name: summarize-document+description: Summarize a long PDF, scan, office file, text file, or markdown file through the connected Superlinked MCP edge instead of reading the whole source into model context. Use when the user asks for a summary, overview, digest, or "what does this document say" about a large file.+---++# Summarize a Document with Superlinked MCP++Use the connected Superlinked MCP server to summarize the source on the SIE+cluster. This mirrors the `summarize-document` flow from the `sie_tools` plugin+in PR #1336, but uses the MCP `summarize_document` tool instead of the+gateway-backed `~/.sie/bin/sie` wrapper.++## Steps++1. Do not open, view, attach, or read the whole source document into context.++2. Call the Superlinked MCP `summarize_document` tool:+ - For PDF, scan, image-of-text, DOCX, PPTX, XLSX, or HTML inputs, read raw+ bytes only, base64-encode them, and pass `document_base64` plus `filename`.+ - For text or markdown inputs, read raw bytes only, base64-encode them, and+ pass `content_base64`.+ - Leave `engine` as `auto` unless the user explicitly asks to force a+ conversion engine.++3. Write the returned `summary` to `processed/<source-stem>.summary.md`.+ Create `processed/` if it does not exist.++4. Your next message must begin with a short receipt:++ ```text+ Summarized <source> -> processed/<source-stem>.summary.md (<summary_chars> chars)+ ```++ If metadata includes `token_savings_estimate`, include it as an estimate.++5. Present the summary from the artifact. If the user asks for exact quotes or+ detailed follow-up, use `parse-document` and inspect only relevant sections+ of the parsed markdown.++## Errors++If the MCP call fails, relay the tool error and do not retry blindly. For auth+or connector errors, tell the user to reinstall the generated MCP plugin pack or+rerun the generated `claude mcp add ... --header 'Authorization: Bearer ...'`+command from `INSTALL.md`.diff --git a/packages/sie_mcp/plugin/superlinked.md b/packages/sie_mcp/plugin/superlinked.mdindex e44c68bf3..4ba83bed9 100644--- a/packages/sie_mcp/plugin/superlinked.md+++ b/packages/sie_mcp/plugin/superlinked.md@@ -3,6 +3,38 @@`superlinked.md` is a router to each surface's **native** install path. There is nodrop-a-file auto-install — pick your surface below.+## Managed sie-test quick install++If a Superlinked operator gives you a hosted MCP endpoint for `sie-test` plus a connector+secret, you can use the MCP-based document offload flow without deploying a self-hosted AWS+cluster. Build a small install pack from this repo:++```bash+mise run mcp-plugin-pack -- \+ --cluster-label sie-test \+ --mcp-url https://<sie-test-mcp-host>/mcp+```++Add `SIE_MCP_CONNECTOR_SECRET=<secret>` or `--connector-secret <secret>` if you want the+generated `INSTALL.md` to include the exact connector command. The command writes:++- `dist/superlinked-docs-plugin/INSTALL.md` — endpoint-specific install steps for Claude+ Code, claude.ai / desktop, and Cowork.+- `dist/superlinked-docs-plugin/superlinked-docs-skill.zip` — the claude.ai skill ZIP.+- `dist/superlinked-docs-plugin/claude-code/*/SKILL.md` — Claude Code skills in the+ local skill layout, including PR #1336-style `parse-document`, `summarize-document`,+ `extract-entities`, and `redact-pii` skills backed by MCP tools.++The connector secret is printed only in `INSTALL.md` when you pass it; it is not embedded+in the skill ZIP or skill file.++The MCP redaction flow returns redacted text and counts, but not a local+placeholder-to-original map; do not use it when de-redaction is required.++For the full operator and user onboarding flow, including running a local edge,+smoke testing it, deploying it with Helm, and generating endpoint-specific install packs,+see `packages/sie_mcp/README.md`.+## Cowork (lead surface)Install the **Superlinked plugin**, which provides this skill together with the remote MCPdiff --git a/packages/sie_mcp/src/sie_mcp/cli.py b/packages/sie_mcp/src/sie_mcp/cli.pyindex 972ed0447..0d7d7f1ae 100644--- a/packages/sie_mcp/src/sie_mcp/cli.py+++ b/packages/sie_mcp/src/sie_mcp/cli.py@@ -9,12 +9,15 @@ from typing import Annotatedimport typerimport uvicorn+from sie_mcp.plugin_pack import build_plugin_packfrom sie_mcp.skill_zip import build_skill_zip, skill_nameapp = typer.Typer(name="sie-mcp", help="SIE MCP edge service (Req 12).", no_args_is_help=True)_PACKAGE_ROOT = Path(__file__).resolve().parents[2]_DEFAULT_SKILL_MD = _PACKAGE_ROOT / "plugin" / "SKILL.md"+_DEFAULT_COWORK_GUIDE = _PACKAGE_ROOT / "plugin" / "superlinked.md"+_DEFAULT_CLAUDE_CODE_SKILLS_DIR = _PACKAGE_ROOT / "plugin" / "claude-code"def _setup_logging(level: str) -> None:@@ -73,6 +76,83 @@ def skill_zip(typer.echo(f"wrote {target} ({len(data)} bytes)")[email protected]("plugin-pack")+def plugin_pack(+ mcp_url: Annotated[+ str,+ typer.Option(+ "--mcp-url",+ envvar="SIE_MCP_URL",+ help="Hosted MCP endpoint to install, e.g. https://mcp.sie-test.example/mcp.",+ ),+ ],+ connector_secret: Annotated[+ str | None,+ typer.Option(+ "--connector-secret",+ envvar="SIE_MCP_CONNECTOR_SECRET",+ help="Optional connector secret to print in INSTALL.md; prefer the env var to avoid shell history.",+ ),+ ] = None,+ cluster_label: Annotated[+ str,+ typer.Option("--cluster-label", help="Human-readable cluster label for the generated install guide."),+ ] = "sie-test",+ skill: Annotated[+ Path,+ typer.Option("--skill", "-s", help="Path to the surface-agnostic Superlinked SKILL.md to package."),+ ] = _DEFAULT_SKILL_MD,+ cowork_guide: Annotated[+ Path | None,+ typer.Option("--cowork-guide", help="Optional Cowork install guide to include in the pack."),+ ] = _DEFAULT_COWORK_GUIDE,+ claude_code_skills_dir: Annotated[+ Path | None,+ typer.Option(+ "--claude-code-skills-dir",+ help="Optional directory of Claude Code skill folders to include in the pack.",+ ),+ ] = _DEFAULT_CLAUDE_CODE_SKILLS_DIR,+ out_dir: Annotated[+ Path,+ typer.Option("--out-dir", "-o", help="Output directory for the plugin pack."),+ ] = _PACKAGE_ROOT / "dist" / "superlinked-docs-plugin",+) -> None:+ """Build a quick install pack for a hosted/test-cluster Superlinked MCP edge."""+ if not skill.is_file():+ raise typer.BadParameter(f"SKILL.md not found at {skill}")+ cowork_text = None+ if cowork_guide is not None:+ if not cowork_guide.is_file():+ raise typer.BadParameter(f"Cowork guide not found at {cowork_guide}")+ cowork_text = cowork_guide.read_text(encoding="utf-8")+ claude_code_skill_mds = []+ if claude_code_skills_dir is not None:+ if not claude_code_skills_dir.is_dir():+ raise typer.BadParameter(f"Claude Code skills directory not found at {claude_code_skills_dir}")+ claude_code_skill_mds = [+ skill_file.read_text(encoding="utf-8") for skill_file in sorted(claude_code_skills_dir.glob("*/SKILL.md"))+ ]+ try:+ report = build_plugin_pack(+ skill.read_text(encoding="utf-8"),+ mcp_url=mcp_url,+ connector_secret=connector_secret,+ cluster_label=cluster_label,+ claude_code_skill_mds=claude_code_skill_mds,+ cowork_guide_md=cowork_text,+ out_dir=out_dir,+ )+ except ValueError as exc:+ raise typer.BadParameter(str(exc)) from exc++ typer.echo(f"wrote plugin pack to {report.out_dir}")+ typer.echo(f"- install guide: {report.install_guide}")+ typer.echo(f"- claude.ai skill ZIP: {report.skill_zip}")+ for skill_path in report.claude_code_skills:+ typer.echo(f"- Claude Code skill: {skill_path}")++@app.command()def version() -> None:"""Show version information."""diff --git a/packages/sie_mcp/src/sie_mcp/config.py b/packages/sie_mcp/src/sie_mcp/config.pyindex 12691596c..50c3f3365 100644--- a/packages/sie_mcp/src/sie_mcp/config.py+++ b/packages/sie_mcp/src/sie_mcp/config.py@@ -79,6 +79,12 @@ DEFAULT_MAX_IMAGE_BYTES = 20 * 1024 * 1024# here as the demo default and re-source from #955 once that decision lands.DEFAULT_VLOCR_MODEL = "opendatalab/MinerU2.5-Pro-2604-1.2B"+# GLiNER models for extract_entities / redact_pii. Env-overridable (SIE_MCP_EXTRACT_MODEL+# / SIE_MCP_PII_MODEL) for parity with the docling/generation model knobs, so a cluster+# that advertises different GLiNER ids can be targeted without a code change.+DEFAULT_EXTRACT_MODEL = "urchade/gliner_multi-v2.1"+DEFAULT_PII_MODEL = "urchade/gliner_multi_pii-v1"+def _parse_connector_secrets(raw: str) -> dict[str, str]:"""Parse ``SIE_MCP_CONNECTOR_SECRETS`` into a ``{secret: user_id}`` map.@@ -168,6 +174,8 @@ class MCPConfig:max_image_bytes: intdocling_model: strgenerate_model: str+ extract_model: str+ pii_model: strmax_output_tokens: intvlocr_model: strencode_model: str@@ -177,6 +185,11 @@ class MCPConfig:image_labels: list[str]image_top_k: intgpu: str | None+ docs_gpu: str | None+ extract_gpu: str | None+ generate_gpu: str | None+ image_gpu: str | None+ qa_gpu: str | Nonetimeout_s: floatqa_top_k: intqa_rerank_candidates: int@@ -204,6 +217,10 @@ class MCPConfig:chunk_overlap = min(max(0, _env_int("SIE_MCP_QA_CHUNK_OVERLAP_CHARS", default=_DEFAULT_QA_CHUNK_OVERLAP_CHARS)), chunk_chars - 1)+ # One global GPU lane (SIE_MCP_GPU); each per-tool override below falls back+ # to it, so a single-knob setup keeps working while a multi-lane cluster can+ # route each tool to its own lane (docling on l4, generation on rtx6000, ...).+ gpu = os.getenv("SIE_MCP_GPU") or Nonereturn cls(sie_base_url=os.getenv("SIE_BASE_URL", _DEFAULT_BASE_URL),sie_api_key=os.getenv("SIE_API_KEY") or None,@@ -218,6 +235,8 @@ class MCPConfig:max_image_bytes=_env_int("SIE_MCP_MAX_IMAGE_BYTES", default=DEFAULT_MAX_IMAGE_BYTES),docling_model=os.getenv("SIE_MCP_DOCLING_MODEL", _DEFAULT_MODEL),generate_model=os.getenv("SIE_MCP_GENERATE_MODEL", _DEFAULT_GENERATE_MODEL),+ extract_model=(os.getenv("SIE_MCP_EXTRACT_MODEL") or "").strip() or DEFAULT_EXTRACT_MODEL,+ pii_model=(os.getenv("SIE_MCP_PII_MODEL") or "").strip() or DEFAULT_PII_MODEL,max_output_tokens=_env_int("SIE_MCP_MAX_OUTPUT_TOKENS", default=_DEFAULT_MAX_OUTPUT_TOKENS),# Treat an empty/whitespace override as unset so OCR routing keeps a real model id.vlocr_model=(os.getenv("SIE_MCP_VLOCR_MODEL") or "").strip() or DEFAULT_VLOCR_MODEL,@@ -229,7 +248,12 @@ class MCPConfig:image_labels=_parse_labels(os.getenv("SIE_MCP_IMAGE_LABELS", ""), default=_DEFAULT_IMAGE_LABELS),# min_value=0 so a caption-only request (SIE_MCP_IMAGE_TOP_K=0) is honored.image_top_k=_env_int("SIE_MCP_IMAGE_TOP_K", default=_DEFAULT_IMAGE_TOP_K, min_value=0),- gpu=os.getenv("SIE_MCP_GPU") or None,+ gpu=gpu,+ docs_gpu=os.getenv("SIE_MCP_DOCS_GPU") or gpu,+ extract_gpu=os.getenv("SIE_MCP_EXTRACT_GPU") or gpu,+ generate_gpu=os.getenv("SIE_MCP_GENERATE_GPU") or gpu,+ image_gpu=os.getenv("SIE_MCP_IMAGE_GPU") or gpu,+ qa_gpu=os.getenv("SIE_MCP_QA_GPU") or gpu,# Document conversion can be slow on a cold model load; default generous.timeout_s=_env_float("SIE_MCP_TIMEOUT_S", default=300.0),qa_top_k=max(1, _env_int("SIE_MCP_QA_TOP_K", default=_DEFAULT_QA_TOP_K)),diff --git a/packages/sie_mcp/src/sie_mcp/offload.py b/packages/sie_mcp/src/sie_mcp/offload.pynew file mode 100644index 000000000..2ea177822--- /dev/null+++ b/packages/sie_mcp/src/sie_mcp/offload.py@@ -0,0 +1,422 @@+"""MCP-backed document offload jobs adapted from the PR #1336 sie_tools skills."""++from __future__ import annotations++import re+from collections import Counter+from collections.abc import Mapping, Sequence+from typing import Any++from sie_mcp.config import DEFAULT_EXTRACT_MODEL, DEFAULT_PII_MODEL++SUMMARY_CHUNK_CHARS = 12_000+SUMMARY_MAP_MAX_TOKENS = 400+SUMMARY_REDUCE_MAX_TOKENS = 700+SUMMARY_REDUCE_BATCH_SIZE = 12++# Defaults for direct offload callers; the MCP tools pass the env-overridable+# config values (SIE_MCP_EXTRACT_MODEL / SIE_MCP_PII_MODEL) instead.+EXTRACT_MODEL = DEFAULT_EXTRACT_MODEL+PII_MODEL = DEFAULT_PII_MODEL++DEFAULT_PII_LABELS = [+ "person",+ "email",+ "phone number",+ "address",+ "social security number",+ "credit card number",+ "passport number",+ "date of birth",+ "ip address",+]++REQUEST_TIMEOUT_S = 600.0+MIN_PII_SCORE = 0.3++# Bounded chunking for the GLiNER extract/redact path. GLiNER runs on a single+# text item per call (no internal chunking), so a large resolved document is+# split into overlapping windows, run per-window, and the entities merged with+# offsets shifted back to the original text. The overlap keeps an entity that+# straddles a window edge fully present in at least one window; a detection that+# touches an interior window edge (likely truncated) is dropped in favor of the+# neighbor window's full span. EXTRACT_MAX_CHARS bounds the fan-out so one+# request cannot spawn an unbounded number of (un-batched, ~1 rps) GLiNER calls.+EXTRACT_CHUNK_CHARS = 8_000+EXTRACT_OVERLAP_CHARS = 256+EXTRACT_MAX_CHARS = 1_000_000++_MAP_PROMPT = (+ "Summarize the following document section into at most 10 dense bullet "+ "points. Keep concrete facts, names, numbers, and decisions; drop "+ "boilerplate.\n\nSECTION:\n{chunk}\n\nBULLET SUMMARY:"+)++_REDUCE_PROMPT = (+ "The following are bullet summaries of consecutive sections of one "+ "document. Merge them into a single coherent markdown summary with a "+ "short opening paragraph and a bullet list of the key points. Do not "+ "invent facts.\n\nSECTION SUMMARIES:\n{parts}\n\nFINAL SUMMARY:"+)++_SINGLE_PROMPT = (+ "Summarize the following document as markdown: a short opening paragraph "+ "followed by a bullet list of the key points. Keep concrete facts, "+ "names, numbers, and decisions. Do not invent facts.\n\nDOCUMENT:\n{text}\n\nSUMMARY:"+)+++class OffloadError(ValueError):+ """Raised when an MCP offload request is malformed or returns unusable output."""+++def chunk_text(text: str, chunk_chars: int = SUMMARY_CHUNK_CHARS) -> list[str]:+ """Split text on paragraph boundaries into chunks of at most ``chunk_chars``."""+ if chunk_chars <= 0:+ raise OffloadError("chunk_chars must be positive")+ if len(text) <= chunk_chars:+ return [text]++ chunks: list[str] = []+ current: list[str] = []+ current_len = 0+ for paragraph in text.split("\n\n"):+ while len(paragraph) > chunk_chars:+ if current:+ chunks.append("\n\n".join(current))+ current, current_len = [], 0+ chunks.append(paragraph[:chunk_chars])+ paragraph = paragraph[chunk_chars:]+ if current_len + len(paragraph) + 2 > chunk_chars and current:+ chunks.append("\n\n".join(current))+ current, current_len = [], 0+ current.append(paragraph)+ current_len += len(paragraph) + 2+ if current:+ chunks.append("\n\n".join(current))+ return [chunk for chunk in chunks if chunk.strip()]+++def estimate_tokens_saved(input_chars: int, artifact_chars: int) -> int:+ """Estimate context tokens avoided when the agent reads the smaller artifact."""+ return max(input_chars // 4 - artifact_chars // 4, 0)+++async def summarize_document(+ client: Any,+ *,+ content: str,+ model: str,+ gpu: str | None = None,+ max_output_tokens: int = SUMMARY_REDUCE_MAX_TOKENS,+) -> dict[str, Any]:+ """Summarize content on the SIE cluster using the PR #1336 map-reduce flow."""+ if not content.strip():+ raise OffloadError("content contains no text to summarize")++ chunks = chunk_text(content, SUMMARY_CHUNK_CHARS)+ reduce_tokens = max(1, max_output_tokens)+ map_tokens = min(SUMMARY_MAP_MAX_TOKENS, reduce_tokens)+ reduce_calls = 0+ reduction_rounds = 0++ if len(chunks) == 1:+ result = await client.generate(+ model,+ _SINGLE_PROMPT.format(text=chunks[0]),+ max_new_tokens=reduce_tokens,+ gpu=gpu,+ wait_for_capacity=True,+ provision_timeout_s=REQUEST_TIMEOUT_S,+ )+ summary = _generated_text(result)+ else:+ summaries: list[str] = []+ for chunk in chunks:+ result = await client.generate(+ model,+ _MAP_PROMPT.format(chunk=chunk),+ max_new_tokens=map_tokens,+ gpu=gpu,+ wait_for_capacity=True,+ provision_timeout_s=REQUEST_TIMEOUT_S,+ )+ summaries.append(_generated_text(result))+ summary, reduce_calls, reduction_rounds = await _reduce_summaries(+ client,+ summaries,+ model=model,+ gpu=gpu,+ max_new_tokens=reduce_tokens,+ )++ summary = summary.strip()+ if not summary:+ raise OffloadError("model returned an empty summary")++ return {+ "summary": summary,+ "metadata": {+ "input_chars": len(content),+ "summary_chars": len(summary),+ "chunks": len(chunks),+ "reduce_calls": reduce_calls,+ "reduction_rounds": reduction_rounds,+ "token_savings_estimate": estimate_tokens_saved(len(content), len(summary)),+ },+ }+++async def _reduce_summaries(+ client: Any,+ summaries: list[str],+ *,+ model: str,+ gpu: str | None,+ max_new_tokens: int,+) -> tuple[str, int, int]:+ """Reduce map summaries recursively so no prompt contains every section."""+ if not summaries:+ raise OffloadError("no summaries to reduce")++ batch_size = max(2, SUMMARY_REDUCE_BATCH_SIZE)+ current = summaries+ reduce_calls = 0+ reduction_rounds = 0+ while len(current) > 1:+ reduction_rounds += 1+ next_round: list[str] = []+ for batch in _batches(current, batch_size):+ if len(batch) == 1:+ next_round.append(batch[0])+ continue+ parts = "\n\n".join(f"## Section {i}\n{part}" for i, part in enumerate(batch, start=1))+ result = await client.generate(+ model,+ _REDUCE_PROMPT.format(parts=parts),+ max_new_tokens=max_new_tokens,+ gpu=gpu,+ wait_for_capacity=True,+ provision_timeout_s=REQUEST_TIMEOUT_S,+ )+ reduce_calls += 1+ next_round.append(_generated_text(result))+ if len(next_round) >= len(current):+ raise OffloadError("summary reduction did not make progress")+ current = next_round+ return current[0], reduce_calls, reduction_rounds+++def _batches(items: Sequence[str], batch_size: int) -> list[list[str]]:+ return [list(items[index : index + batch_size]) for index in range(0, len(items), batch_size)]+++def _generated_text(result: Mapping[str, Any]) -> str:+ text = result.get("text")+ if not isinstance(text, str):+ raise OffloadError("generation result did not include text")+ return text+++def _extract_windows(content: str, chunk_chars: int, overlap: int) -> list[tuple[int, str]]:+ """Overlapping ``(base_offset, window)`` tuples covering ``content`` exactly."""+ if len(content) <= chunk_chars:+ return [(0, content)]+ step = max(1, chunk_chars - overlap)+ windows: list[tuple[int, str]] = []+ index = 0+ length = len(content)+ while index < length:+ windows.append((index, content[index : index + chunk_chars]))+ if index + chunk_chars >= length:+ break+ index += step+ return windows+++async def _gliner_entities(+ client: Any,+ *,+ content: str,+ labels: Sequence[str],+ model: str,+ gpu: str | None,+) -> list[dict[str, Any]]:+ """Run GLiNER over ``content``, chunking large inputs and merging offset-adjusted spans.++ GLiNER is called on one text item per request, so a document larger than+ ``EXTRACT_CHUNK_CHARS`` is split into overlapping windows; each window's+ entities are shifted back to the original offsets and de-duplicated. A+ detection clipped at an interior window edge is dropped (its overlapping+ neighbor holds the full span). Inputs over ``EXTRACT_MAX_CHARS`` are rejected+ rather than fanned into an unbounded number of GLiNER calls.+ """+ if len(content) > EXTRACT_MAX_CHARS:+ raise OffloadError(+ f"content is {len(content)} characters, over the {EXTRACT_MAX_CHARS}-character "+ "extraction limit; summarize or section the document first, or send a smaller piece"+ )++ async def _run(text: str) -> list[Mapping[str, Any]]:+ result = await client.extract(+ model,+ {"text": text},+ labels=list(labels),+ gpu=gpu,+ wait_for_capacity=True,+ provision_timeout_s=REQUEST_TIMEOUT_S,+ )+ return list(result.get("entities", []))++ windows = _extract_windows(content, EXTRACT_CHUNK_CHARS, EXTRACT_OVERLAP_CHARS)+ if len(windows) == 1:+ return [dict(entity) for entity in await _run(content)]++ merged: dict[tuple[Any, ...], dict[str, Any]] = {}+ last = len(windows) - 1+ for position, (base, window) in enumerate(windows):+ window_len = len(window)+ for entity in await _run(window):+ start = entity.get("start")+ end = entity.get("end")+ # Drop detections clipped at an interior window edge; the overlapping+ # neighbor window holds the full, untruncated span.+ if position != 0 and start == 0:+ continue+ if position != last and end == window_len:+ continue+ shifted = dict(entity)+ if start is not None:+ shifted["start"] = int(start) + base+ if end is not None:+ shifted["end"] = int(end) + base+ key = (shifted.get("start"), shifted.get("end"), shifted.get("label"), shifted.get("text"))+ existing = merged.get(key)+ if existing is None or float(shifted.get("score", 0.0)) > float(existing.get("score", 0.0)):+ merged[key] = shifted+ return sorted(+ merged.values(),+ key=lambda entity: (entity["start"] if entity.get("start") is not None else 0, str(entity.get("label", ""))),+ )+++async def extract_entities(+ client: Any,+ *,+ content: str,+ labels: list[str],+ model: str = EXTRACT_MODEL,+ gpu: str | None = None,+) -> dict[str, Any]:+ """Extract zero-shot entities and return a compact table."""+ if not content.strip():+ raise OffloadError("content contains no text to extract from")+ labels = [label.strip() for label in labels if label.strip()]+ if not labels:+ raise OffloadError("at least one entity label is required")++ entities = await _gliner_entities(client, content=content, labels=labels, model=model, gpu=gpu)+ table = entities_table(entities, labels)+ return {+ "entities": entities,+ "markdown_table": table,+ "metadata": {+ "input_chars": len(content),+ "entity_count": len(entities),+ "label_counts": dict(Counter(entity.get("label", "") for entity in entities)),+ "token_savings_estimate": estimate_tokens_saved(len(content), len(table)),+ },+ }+++def entities_table(entities: Sequence[Mapping[str, Any]], labels: list[str]) -> str:+ """Render extracted entities as a markdown table."""+ lines = ["| Entity | Label | Score |", "| --- | --- | --- |"]+ for entity in entities:+ text = str(entity.get("text", ""))+ label = str(entity.get("label", ""))+ score = float(entity.get("score", 0.0))+ lines.append(f"| {text} | {label} | {score:.2f} |")+ header = f"# Extracted entities ({', '.join(labels)})\n"+ return header + "\n" + "\n".join(lines) + "\n"+++async def redact_pii(+ client: Any,+ *,+ content: str,+ labels: list[str] | None = None,+ model: str = PII_MODEL,+ gpu: str | None = None,+) -> dict[str, Any]:+ """Redact PII spans and return only the redacted text plus counts."""+ if not content.strip():+ raise OffloadError("content contains no text to redact")+ resolved_labels = labels or DEFAULT_PII_LABELS++ entities = await _gliner_entities(client, content=content, labels=resolved_labels, model=model, gpu=gpu)+ redacted, placeholder_map, span_count = redact_text(content, entities)+ return {+ "redacted_text": redacted,+ "metadata": {+ "span_count": span_count,+ "label_counts": _label_counts_from_placeholders(placeholder_map),+ "token_savings_estimate": estimate_tokens_saved(len(content), len(redacted)),+ "pii_map_returned": False,+ },+ }+++def _placeholder_base(label: str) -> str:+ return re.sub(r"[^A-Z0-9]+", "_", label.upper()).strip("_")+++def redact_text(text: str, entities: Sequence[Mapping[str, Any]]) -> tuple[str, dict[str, str], int]:+ """Replace detected spans with placeholders, keeping original values server-side only."""+ spans = [+ entity+ for entity in entities+ if entity.get("start") is not None+ and entity.get("end") is not None+ and float(entity.get("score", 1.0)) >= MIN_PII_SCORE+ ]+ spans.sort(key=lambda entity: (-float(entity.get("score", 0.0)), int(entity["start"])))++ chosen: list[Mapping[str, Any]] = []+ taken: list[tuple[int, int]] = []+ for span in spans:+ start, end = int(span["start"]), int(span["end"])+ if any(start < taken_end and end > taken_start for taken_start, taken_end in taken):+ continue+ chosen.append(span)+ taken.append((start, end))++ placeholder_map: dict[str, str] = {}+ label_counters: dict[str, int] = {}+ assignments: dict[tuple[str, str], str] = {}+ for span in chosen:+ start, end = int(span["start"]), int(span["end"])+ label = str(span["label"])+ key = (text[start:end], label)+ if key not in assignments:+ base = _placeholder_base(label)+ label_counters[base] = label_counters.get(base, 0) + 1+ placeholder = f"[{base}_{label_counters[base]}]"+ assignments[key] = placeholder+ placeholder_map[placeholder] = key[0]++ redacted = text+ for span in sorted(chosen, key=lambda entity: int(entity["start"]), reverse=True):+ start, end = int(span["start"]), int(span["end"])+ key = (text[start:end], str(span["label"]))+ redacted = redacted[:start] + assignments[key] + redacted[end:]++ return redacted, placeholder_map, len(chosen)+++def _label_counts_from_placeholders(placeholder_map: Mapping[str, str]) -> dict[str, int]:+ label_counts: dict[str, int] = {}+ for placeholder in placeholder_map:+ base = placeholder.strip("[]").rsplit("_", 1)[0].lower().replace("_", " ")+ label_counts[base] = label_counts.get(base, 0) + 1+ return label_countsdiff --git a/packages/sie_mcp/src/sie_mcp/plugin_pack.py b/packages/sie_mcp/src/sie_mcp/plugin_pack.pynew file mode 100644index 000000000..897b4ac60--- /dev/null+++ b/packages/sie_mcp/src/sie_mcp/plugin_pack.py@@ -0,0 +1,185 @@+"""Build a ready-to-share plugin install pack for a hosted SIE MCP edge."""++from __future__ import annotations++import shlex+import shutil+from collections.abc import Iterable+from dataclasses import dataclass+from pathlib import Path+from urllib.parse import urlparse, urlunparse++from sie_mcp.skill_zip import build_skill_zip, skill_name+++@dataclass(frozen=True)+class PluginPackReport:+ """Paths written by ``build_plugin_pack``."""++ out_dir: Path+ mcp_url: str+ skill_name: str+ skill_zip: Path+ claude_code_skills: tuple[Path, ...]+ install_guide: Path+ cowork_guide: Path | None++ @property+ def claude_code_skill(self) -> Path:+ """Backward-compatible primary Claude Code skill path."""+ return self.claude_code_skills[0]+++def normalize_mcp_url(raw: str) -> str:+ """Return a clean absolute MCP endpoint URL whose path ends with ``/mcp``."""+ value = raw.strip()+ if not value:+ raise ValueError("MCP URL is required")+ parsed = urlparse(value)+ if parsed.scheme not in {"http", "https"} or not parsed.netloc:+ raise ValueError("MCP URL must be an absolute http(s) URL")+ if parsed.query or parsed.fragment:+ raise ValueError("MCP URL must not include a query string or fragment")++ path = parsed.path.rstrip("/")+ if not path:+ path = "/mcp"+ elif not path.endswith("/mcp"):+ raise ValueError("MCP URL path must end with /mcp")++ return urlunparse(parsed._replace(path=path, params="", query="", fragment=""))+++def build_plugin_pack(+ skill_md: str,+ *,+ mcp_url: str,+ out_dir: Path,+ connector_secret: str | None = None,+ cluster_label: str = "sie-test",+ claude_code_skill_mds: Iterable[str] = (),+ cowork_guide_md: str | None = None,+) -> PluginPackReport:+ """Write a hosted-cluster plugin pack: skill ZIP, Claude Code skill, and install guide."""+ normalized_url = normalize_mcp_url(mcp_url)+ name = skill_name(skill_md)++ out_dir.mkdir(parents=True, exist_ok=True)++ skill_zip = out_dir / f"{name}-skill.zip"+ skill_zip.write_bytes(build_skill_zip(skill_md))++ claude_code_skills = _write_claude_code_skills(out_dir, [skill_md, *claude_code_skill_mds])++ cowork_guide = None+ if cowork_guide_md is not None:+ cowork_dir = out_dir / "cowork"+ cowork_dir.mkdir(parents=True, exist_ok=True)+ cowork_guide = cowork_dir / "superlinked.md"+ cowork_guide.write_text(cowork_guide_md, encoding="utf-8")++ install_guide = out_dir / "INSTALL.md"+ install_guide.write_text(+ render_install_guide(+ cluster_label=cluster_label,+ mcp_url=normalized_url,+ connector_secret=connector_secret,+ skill_name_value=name,+ skill_zip_name=skill_zip.name,+ claude_code_skill_names=tuple(path.parent.name for path in claude_code_skills),+ has_cowork_guide=cowork_guide is not None,+ ),+ encoding="utf-8",+ )++ return PluginPackReport(+ out_dir=out_dir,+ mcp_url=normalized_url,+ skill_name=name,+ skill_zip=skill_zip,+ claude_code_skills=tuple(claude_code_skills),+ install_guide=install_guide,+ cowork_guide=cowork_guide,+ )+++def _write_claude_code_skills(out_dir: Path, skill_mds: Iterable[str]) -> list[Path]:+ """Write unique Claude Code skills in Claude's local skill layout."""+ claude_code_root = out_dir / "claude-code"+ if claude_code_root.exists():+ shutil.rmtree(claude_code_root)++ paths: list[Path] = []+ seen: set[str] = set()+ for skill_md in skill_mds:+ name = skill_name(skill_md)+ if name in seen:+ continue+ seen.add(name)+ claude_code_dir = claude_code_root / name+ claude_code_dir.mkdir(parents=True, exist_ok=True)+ skill_path = claude_code_dir / "SKILL.md"+ skill_path.write_text(skill_md, encoding="utf-8")+ paths.append(skill_path)+ return paths+++def render_install_guide(+ *,+ cluster_label: str,+ mcp_url: str,+ connector_secret: str | None,+ skill_name_value: str,+ skill_zip_name: str,+ claude_code_skill_names: tuple[str, ...],+ has_cowork_guide: bool,+) -> str:+ """Render endpoint-specific install instructions for the generated plugin pack."""+ secret = connector_secret or "<connector-secret>"+ auth_header = f"Authorization: Bearer {secret}"+ claude_code_add = (+ "claude mcp add --scope user --transport http "+ f"{skill_name_value} {shlex.quote(mcp_url)} --header {shlex.quote(auth_header)}"+ )+ cowork_note = "- `cowork/superlinked.md` - Cowork/plugin install notes.\n" if has_cowork_guide else ""++ return (+ f"# Superlinked MCP plugin pack for {cluster_label}\n\n"+ "This pack connects an agent surface to an already-running Superlinked MCP edge. "+ "Use it for the hosted sie-test flow or any managed test cluster where an operator "+ "has given you an MCP URL and connector secret. You do not need to deploy AWS infra.\n\n"+ "## Files\n\n"+ f"- `{skill_zip_name}` - uploadable skill ZIP for claude.ai.\n"+ f"- `claude-code/*/SKILL.md` - Claude Code skill files ({', '.join(claude_code_skill_names)}).\n"+ f"{cowork_note}"+ "\n"+ "## Connector\n\n"+ f"- MCP endpoint: `{mcp_url}`\n"+ f"- Connector secret: `{secret}`\n\n"+ "The connector secret is used only in connector settings or the Claude Code MCP command. "+ "It is not embedded in the skill ZIP or the Claude Code skill file.\n\n"+ "## Claude Code\n\n"+ "Run these commands from this directory:\n\n"+ "```bash\n"+ f"{claude_code_add}\n"+ "mkdir -p ~/.claude/skills\n"+ "cp -R claude-code/* ~/.claude/skills/\n"+ "```\n\n"+ "Restart Claude Code after adding the server and skills. The Claude Code skills mirror "+ "the PR #1336 parse, summarize, entity-extraction, and PII-redaction flows, but call "+ "the MCP tools exposed by the Req 12 edge instead of the gateway-backed `sie_tools` CLI. "+ "The MCP redaction flow returns redacted text and counts, but not a local "+ "placeholder-to-original map; do not use it when de-redaction is required.\n\n"+ "## claude.ai / Claude desktop app\n\n"+ "1. Add a custom connector with the MCP endpoint above.\n"+ "2. Click Connect and complete the OAuth sign-in. Enter the connector secret on the "+ "Superlinked authorize page, not in chat.\n"+ f"3. Upload `{skill_zip_name}` as the Superlinked document-offload skill.\n\n"+ "## Cowork\n\n"+ "Add a custom MCP connector with the endpoint above and this header:\n\n"+ "```text\n"+ f"{auth_header}\n"+ "```\n\n"+ "Then install the Superlinked document-offload skill from `packages/sie_mcp/plugin/SKILL.md` "+ "or the Cowork guide in this pack if present.\n"+ )diff --git a/packages/sie_mcp/src/sie_mcp/server.py b/packages/sie_mcp/src/sie_mcp/server.pyindex 77c7850c9..e50c6b4c9 100644--- a/packages/sie_mcp/src/sie_mcp/server.py+++ b/packages/sie_mcp/src/sie_mcp/server.py@@ -4,6 +4,8 @@ Tracer bullet (#1306): a single ``docs_to_markdown`` tool. The cluster client iscreated once per process in the lifespan and reused across requests."""+import base64+import binasciiimport loggingfrom collections.abc import AsyncIteratorfrom contextlib import asynccontextmanager@@ -13,12 +15,61 @@ from mcp.server.fastmcp import Context, FastMCPfrom mcp.server.transport_security import TransportSecuritySettingsfrom sie_sdk import SIEAsyncClient-from sie_mcp import describe, jobs, qa, structured+from sie_mcp import describe, jobs, offload, qa, structuredfrom sie_mcp.config import MCPConfiglogger = logging.getLogger(__name__)+def _decode_base64_text(content_base64: str, max_bytes: int) -> str:+ try:+ raw = base64.b64decode(content_base64, validate=True)+ except (binascii.Error, ValueError) as exc:+ raise ValueError("content_base64 must be valid base64") from exc+ if len(raw) > max_bytes:+ raise ValueError(f"decoded content exceeds {max_bytes} bytes")+ return raw.decode("utf-8", errors="replace")+++def _validate_plain_text_size(content: str, max_bytes: int) -> str:+ if len(content.encode("utf-8")) > max_bytes:+ raise ValueError(f"content exceeds {max_bytes} bytes")+ return content+++async def _resolve_text_input(+ client: Any,+ config: MCPConfig,+ *,+ content: str | None,+ content_base64: str | None,+ document_base64: str | None,+ filename: str | None,+ engine: jobs.EngineName,+) -> tuple[str, dict[str, Any]]:+ provided = [content is not None, content_base64 is not None, document_base64 is not None]+ if sum(provided) != 1:+ raise ValueError("provide exactly one of content, content_base64, or document_base64")+ if content is not None:+ return _validate_plain_text_size(content, config.max_document_bytes), {"input_type": "content"}+ if content_base64 is not None:+ return _decode_base64_text(content_base64, config.max_document_bytes), {"input_type": "content_base64"}++ assert document_base64 is not None+ result = await jobs.docs_to_markdown(+ client,+ document_base64=document_base64,+ filename=filename,+ ocr=False,+ engine=engine,+ model=config.docling_model,+ vlocr_model=config.vlocr_model,+ gpu=config.docs_gpu,+ max_document_bytes=config.max_document_bytes,+ )+ return result["markdown"], {"input_type": "document_base64", "document_metadata": result["metadata"]}++@asynccontextmanagerasync def _lifespan(_server: FastMCP) -> AsyncIterator[dict[str, Any]]:config = MCPConfig.from_env()@@ -99,7 +150,7 @@ def build_server(config: MCPConfig) -> FastMCP:engine=engine,model=config.docling_model,vlocr_model=config.vlocr_model,- gpu=config.gpu,+ gpu=config.docs_gpu,max_document_bytes=config.max_document_bytes,)return {"markdown": result["markdown"], "metadata": result["metadata"]}@@ -144,10 +195,139 @@ def build_server(config: MCPConfig) -> FastMCP:max_document_chars=config.qa_max_document_chars,max_questions=config.qa_max_questions,max_chunks=config.qa_max_chunks,- gpu=config.gpu,+ gpu=config.qa_gpu,)return {"answers": result["answers"]}+ @server.tool()+ async def summarize_document(+ ctx: Context,+ content: str | None = None,+ content_base64: str | None = None,+ document_base64: str | None = None,+ filename: str | None = None,+ engine: jobs.EngineName = "auto",+ model: str | None = None,+ max_output_tokens: int | None = None,+ ) -> dict[str, Any]:+ """Summarize a document/text input on the SIE cluster.++ Provide exactly one of ``content``, ``content_base64``, or ``document_base64``.+ For source documents, pass raw file bytes as ``document_base64``; the edge first+ converts them through ``docs_to_markdown`` and then summarizes the markdown. This+ mirrors the PR #1336 summarize-document skill without routing through the+ gateway-backed ``sie_tools`` CLI.++ Args:+ content: Plain text/markdown content. Prefer ``content_base64`` for large files+ so the calling model does not read the content directly.+ content_base64: UTF-8 text/markdown bytes, base64-encoded.+ document_base64: Source document bytes, base64-encoded.+ filename: Optional source filename; used when ``document_base64`` is set.+ engine: Document conversion engine for ``document_base64`` inputs.+ model: Optional generation model override.+ max_output_tokens: Optional summary token ceiling.+ """+ lifespan_ctx = ctx.request_context.lifespan_context+ client = lifespan_ctx["client"]+ config: MCPConfig = lifespan_ctx["config"]+ text, input_metadata = await _resolve_text_input(+ client,+ config,+ content=content,+ content_base64=content_base64,+ document_base64=document_base64,+ filename=filename,+ engine=engine,+ )+ result = await offload.summarize_document(+ client,+ content=text,+ model=model or config.generate_model,+ gpu=config.generate_gpu,+ max_output_tokens=max_output_tokens or offload.SUMMARY_REDUCE_MAX_TOKENS,+ )+ result["metadata"] = {**input_metadata, **result["metadata"]}+ return result++ @server.tool()+ async def extract_entities(+ ctx: Context,+ labels: list[str],+ content: str | None = None,+ content_base64: str | None = None,+ document_base64: str | None = None,+ filename: str | None = None,+ engine: jobs.EngineName = "auto",+ model: str | None = None,+ ) -> dict[str, Any]:+ """Extract zero-shot entities from a document/text input on the SIE cluster.++ Provide labels such as ``["person", "organization", "date", "amount"]`` and+ exactly one of ``content``, ``content_base64``, or ``document_base64``. Document+ inputs are converted to markdown first, matching the PR #1336 flow.+ """+ lifespan_ctx = ctx.request_context.lifespan_context+ client = lifespan_ctx["client"]+ config: MCPConfig = lifespan_ctx["config"]+ text, input_metadata = await _resolve_text_input(+ client,+ config,+ content=content,+ content_base64=content_base64,+ document_base64=document_base64,+ filename=filename,+ engine=engine,+ )+ result = await offload.extract_entities(+ client,+ content=text,+ labels=labels,+ model=model or config.extract_model,+ gpu=config.extract_gpu,+ )+ result["metadata"] = {**input_metadata, **result["metadata"]}+ return result++ @server.tool()+ async def redact_pii(+ ctx: Context,+ content: str | None = None,+ content_base64: str | None = None,+ document_base64: str | None = None,+ filename: str | None = None,+ engine: jobs.EngineName = "auto",+ labels: list[str] | None = None,+ model: str | None = None,+ ) -> dict[str, Any]:+ """Redact PII from a document/text input on the SIE cluster.++ The tool returns redacted text and counts, but intentionally does not return the+ placeholder-to-original map. That preserves the MCP privacy contract: original PII+ is not handed back to the calling model.+ """+ lifespan_ctx = ctx.request_context.lifespan_context+ client = lifespan_ctx["client"]+ config: MCPConfig = lifespan_ctx["config"]+ text, input_metadata = await _resolve_text_input(+ client,+ config,+ content=content,+ content_base64=content_base64,+ document_base64=document_base64,+ filename=filename,+ engine=engine,+ )+ result = await offload.redact_pii(+ client,+ content=text,+ labels=labels,+ model=model or config.pii_model,+ gpu=config.extract_gpu,+ )+ result["metadata"] = {**input_metadata, **result["metadata"]}+ return result+@server.tool()async def describe_image(ctx: Context,@@ -182,7 +362,7 @@ def build_server(config: MCPConfig) -> FastMCP:embed_model=config.embed_model,detailed=detailed,top_k=top_k if top_k is not None else config.image_top_k,- gpu=config.gpu,+ gpu=config.image_gpu,max_image_bytes=config.max_image_bytes,)return {"caption": result["caption"], "tags": result["tags"]}@@ -228,7 +408,7 @@ def build_server(config: MCPConfig) -> FastMCP:output_schema=output_schema,instruction=instruction,model=model or config.generate_model,- gpu=config.gpu,+ gpu=config.generate_gpu,max_completion_tokens=max_output_tokens or config.max_output_tokens,)return {"data": data}@@ -271,7 +451,7 @@ def build_server(config: MCPConfig) -> FastMCP:prompt=prompt,response_format=response_format,model=model or config.generate_model,- gpu=config.gpu,+ gpu=config.generate_gpu,max_completion_tokens=max_output_tokens or config.max_output_tokens,)return {"content": content}diff --git a/packages/sie_mcp/src/sie_mcp/structured.py b/packages/sie_mcp/src/sie_mcp/structured.pyindex 072617a96..f7bb98d8e 100644--- a/packages/sie_mcp/src/sie_mcp/structured.py+++ b/packages/sie_mcp/src/sie_mcp/structured.py@@ -83,9 +83,15 @@ _MAX_EBNF_LEN = 8 * 1024# Models whose generation profile is Outlines-backed and therefore advertise# only ``json_schema`` + ``regex`` (EBNF/grammar is an upstream SGLang/Outlines-# limitation). An EBNF request to one of these is rejected up front. The-# production Qwen3.5 profile (``grammar_backend: outlines``) seeds the set.-_OUTLINES_BACKED_MODELS = frozenset({"Qwen/Qwen3.5-4B"})+# limitation). An EBNF request to one of these is rejected up front. Both 4B+# generation profiles served on the test cluster (``grammar_backend: outlines``)+# seed the set.+_OUTLINES_BACKED_MODELS = frozenset(+ {+ "Qwen/Qwen3.5-4B",+ "Qwen/Qwen3-4B-Instruct-2507",+ }+)_EXTRACT_SYSTEM = ("You extract structured data from the supplied document content. Use only "diff --git a/packages/sie_mcp/tests/test_auth.py b/packages/sie_mcp/tests/test_auth.pyindex b53bbbda3..83320a9c9 100644--- a/packages/sie_mcp/tests/test_auth.py+++ b/packages/sie_mcp/tests/test_auth.py@@ -17,6 +17,8 @@ def _cfg(**overrides: Any) -> MCPConfig:"max_image_bytes": DEFAULT_MAX_IMAGE_BYTES,"docling_model": "docling","generate_model": "Qwen/Qwen3.5-4B",+ "extract_model": "urchade/gliner_multi-v2.1",+ "pii_model": "urchade/gliner_multi_pii-v1","max_output_tokens": 4096,"vlocr_model": "opendatalab/MinerU2.5-Pro-2604-1.2B","encode_model": "BAAI/bge-m3",@@ -26,6 +28,11 @@ def _cfg(**overrides: Any) -> MCPConfig:"image_labels": [],"image_top_k": 5,"gpu": None,+ "docs_gpu": None,+ "extract_gpu": None,+ "generate_gpu": None,+ "image_gpu": None,+ "qa_gpu": None,"timeout_s": 300.0,"qa_top_k": 5,"qa_rerank_candidates": 20,diff --git a/packages/sie_mcp/tests/test_config.py b/packages/sie_mcp/tests/test_config.pyindex ead3bf20f..bbdebfa56 100644--- a/packages/sie_mcp/tests/test_config.py+++ b/packages/sie_mcp/tests/test_config.py@@ -1,8 +1,10 @@import pytestfrom sie_mcp.config import (_DEFAULT_IMAGE_TOP_K,+ DEFAULT_EXTRACT_MODEL,DEFAULT_MAX_DOCUMENT_BYTES,DEFAULT_MAX_IMAGE_BYTES,+ DEFAULT_PII_MODEL,DEFAULT_VLOCR_MODEL,MCPConfig,)@@ -79,3 +81,67 @@ def test_image_top_k_zero_is_honored(monkeypatch: pytest.MonkeyPatch) -> None:def test_image_top_k_falls_back_on_bad_value(monkeypatch: pytest.MonkeyPatch, bad: str) -> None:monkeypatch.setenv("SIE_MCP_IMAGE_TOP_K", bad)assert MCPConfig.from_env().image_top_k == _DEFAULT_IMAGE_TOP_K+++def test_gliner_models_default_when_unset(monkeypatch: pytest.MonkeyPatch) -> None:+ monkeypatch.delenv("SIE_MCP_EXTRACT_MODEL", raising=False)+ monkeypatch.delenv("SIE_MCP_PII_MODEL", raising=False)+ cfg = MCPConfig.from_env()+ assert cfg.extract_model == DEFAULT_EXTRACT_MODEL+ assert cfg.pii_model == DEFAULT_PII_MODEL+++def test_gliner_models_honor_overrides(monkeypatch: pytest.MonkeyPatch) -> None:+ monkeypatch.setenv("SIE_MCP_EXTRACT_MODEL", "some/other-gliner")+ monkeypatch.setenv("SIE_MCP_PII_MODEL", "some/other-pii")+ cfg = MCPConfig.from_env()+ assert cfg.extract_model == "some/other-gliner"+ assert cfg.pii_model == "some/other-pii"++[email protected]("blank", ["", " "])+def test_blank_gliner_models_fall_back(monkeypatch: pytest.MonkeyPatch, blank: str) -> None:+ monkeypatch.setenv("SIE_MCP_EXTRACT_MODEL", blank)+ monkeypatch.setenv("SIE_MCP_PII_MODEL", blank)+ cfg = MCPConfig.from_env()+ assert cfg.extract_model == DEFAULT_EXTRACT_MODEL+ assert cfg.pii_model == DEFAULT_PII_MODEL+++_PER_TOOL_GPU_VARS = (+ "SIE_MCP_DOCS_GPU",+ "SIE_MCP_EXTRACT_GPU",+ "SIE_MCP_GENERATE_GPU",+ "SIE_MCP_IMAGE_GPU",+ "SIE_MCP_QA_GPU",+)+++def test_per_tool_gpu_defaults_to_global(monkeypatch: pytest.MonkeyPatch) -> None:+ for var in _PER_TOOL_GPU_VARS:+ monkeypatch.delenv(var, raising=False)+ monkeypatch.setenv("SIE_MCP_GPU", "rtx6000")+ cfg = MCPConfig.from_env()+ assert cfg.gpu == "rtx6000"+ assert (cfg.docs_gpu, cfg.extract_gpu, cfg.generate_gpu, cfg.image_gpu, cfg.qa_gpu) == (("rtx6000",) * 5)+++def test_per_tool_gpu_overrides_win(monkeypatch: pytest.MonkeyPatch) -> None:+ monkeypatch.setenv("SIE_MCP_GPU", "l4")+ monkeypatch.setenv("SIE_MCP_GENERATE_GPU", "rtx6000")+ monkeypatch.setenv("SIE_MCP_EXTRACT_GPU", "rtx6000")+ cfg = MCPConfig.from_env()+ assert cfg.generate_gpu == "rtx6000"+ assert cfg.extract_gpu == "rtx6000"+ # untouched lanes fall back to the global SIE_MCP_GPU+ assert cfg.docs_gpu == "l4"+ assert cfg.image_gpu == "l4"+ assert cfg.qa_gpu == "l4"+++def test_gpu_is_none_when_nothing_set(monkeypatch: pytest.MonkeyPatch) -> None:+ for var in ("SIE_MCP_GPU", *_PER_TOOL_GPU_VARS):+ monkeypatch.delenv(var, raising=False)+ cfg = MCPConfig.from_env()+ assert cfg.gpu is None+ assert cfg.generate_gpu is Nonediff --git a/packages/sie_mcp/tests/test_oauth.py b/packages/sie_mcp/tests/test_oauth.pyindex 32deee3ac..b237aada5 100644--- a/packages/sie_mcp/tests/test_oauth.py+++ b/packages/sie_mcp/tests/test_oauth.py@@ -31,6 +31,8 @@ def _cfg(**overrides: Any) -> MCPConfig:"max_image_bytes": DEFAULT_MAX_IMAGE_BYTES,"docling_model": "docling","generate_model": "Qwen/Qwen3.5-4B",+ "extract_model": "urchade/gliner_multi-v2.1",+ "pii_model": "urchade/gliner_multi_pii-v1","max_output_tokens": 4096,"vlocr_model": "opendatalab/MinerU2.5-Pro-2604-1.2B","encode_model": "BAAI/bge-m3",@@ -40,6 +42,11 @@ def _cfg(**overrides: Any) -> MCPConfig:"image_labels": [],"image_top_k": 5,"gpu": None,+ "docs_gpu": None,+ "extract_gpu": None,+ "generate_gpu": None,+ "image_gpu": None,+ "qa_gpu": None,"timeout_s": 300.0,"qa_top_k": 5,"qa_rerank_candidates": 20,diff --git a/packages/sie_mcp/tests/test_offload.py b/packages/sie_mcp/tests/test_offload.pynew file mode 100644index 000000000..3baf241a0--- /dev/null+++ b/packages/sie_mcp/tests/test_offload.py@@ -0,0 +1,219 @@+from __future__ import annotations++from typing import Any++import pytest+from sie_mcp import offload+++class _FakeOffloadClient:+ def __init__(self) -> None:+ self.generate_calls: list[dict[str, Any]] = []+ self.extract_calls: list[dict[str, Any]] = []++ async def generate(self, model: str, prompt: str, **kwargs: Any) -> dict[str, str]:+ self.generate_calls.append({"model": model, "prompt": prompt, **kwargs})+ return {"text": f"summary {len(self.generate_calls)}"}++ async def extract(self, model: str, items: dict[str, str], **kwargs: Any) -> dict[str, Any]:+ self.extract_calls.append({"model": model, "items": items, **kwargs})+ if model == offload.PII_MODEL:+ text = items["text"]+ return {+ "entities": [+ {+ "text": "Alice Example",+ "label": "person",+ "start": text.index("Alice Example"),+ "end": text.index("Alice Example") + len("Alice Example"),+ "score": 0.97,+ },+ {+ "text": "[email protected]",+ "label": "email",+ "start": text.index("[email protected]"),+ "end": text.index("[email protected]") + len("[email protected]"),+ "score": 0.98,+ },+ ]+ }+ return {+ "entities": [+ {"text": "Alice Example", "label": "person", "score": 0.93},+ {"text": "Superlinked", "label": "organization", "score": 0.88},+ ]+ }+++async def test_summarize_document_uses_map_reduce_for_large_content() -> None:+ client = _FakeOffloadClient()+ text = ("alpha " * 1200) + "\n\n" + ("bravo " * 1200)++ result = await offload.summarize_document(+ client,+ content=text,+ model="gen",+ gpu="l4",+ max_output_tokens=128,+ )++ assert result["summary"] == "summary 3"+ assert result["metadata"]["chunks"] == 2+ assert result["metadata"]["token_savings_estimate"] > 0+ assert [call["model"] for call in client.generate_calls] == ["gen", "gen", "gen"]+ assert all(call["gpu"] == "l4" for call in client.generate_calls)+++async def test_summarize_document_reduces_many_chunks_hierarchically() -> None:+ client = _FakeOffloadClient()+ chunk_count = offload.SUMMARY_REDUCE_BATCH_SIZE + 1+ text = "\n\n".join("x" * offload.SUMMARY_CHUNK_CHARS for _ in range(chunk_count))++ result = await offload.summarize_document(+ client,+ content=text,+ model="gen",+ max_output_tokens=128,+ )++ reduce_prompts = [call["prompt"] for call in client.generate_calls if "SECTION SUMMARIES:" in call["prompt"]]+ assert result["metadata"]["chunks"] == chunk_count+ assert result["metadata"]["reduce_calls"] == 2+ assert result["metadata"]["reduction_rounds"] == 2+ assert result["summary"] == f"summary {chunk_count + 2}"+ assert len(client.generate_calls) == chunk_count + 2+ assert all(prompt.count("## Section") <= offload.SUMMARY_REDUCE_BATCH_SIZE for prompt in reduce_prompts)+++async def test_extract_entities_returns_entities_and_markdown_table() -> None:+ client = _FakeOffloadClient()++ result = await offload.extract_entities(+ client,+ content="Alice Example works at Superlinked.",+ labels=["person", "organization"],+ model="ner",+ )++ assert result["metadata"]["entity_count"] == 2+ assert result["entities"][0]["text"] == "Alice Example"+ assert "| Alice Example | person | 0.93 |" in result["markdown_table"]+ assert client.extract_calls[0]["labels"] == ["person", "organization"]+++async def test_redact_pii_returns_redacted_text_without_original_map() -> None:+ client = _FakeOffloadClient()++ result = await offload.redact_pii(+ client,+ content="Alice Example can be reached at [email protected].",+ )++ assert result["redacted_text"] == "[PERSON_1] can be reached at [EMAIL_1]."+ assert result["metadata"]["span_count"] == 2+ assert result["metadata"]["label_counts"] == {"person": 1, "email": 1}+ assert result["metadata"]["pii_map_returned"] is False+ assert "Alice Example" not in result["redacted_text"]+++def test_redact_text_drops_overlapping_lower_score_spans() -> None:+ redacted, placeholder_map, count = offload.redact_text(+ "Alice Example",+ [+ {"label": "person", "start": 0, "end": 5, "score": 0.5},+ {"label": "person", "start": 0, "end": 13, "score": 0.9},+ ],+ )++ assert redacted == "[PERSON_1]"+ assert placeholder_map == {"[PERSON_1]": "Alice Example"}+ assert count == 1+++ ("content", "labels"),+ [+ ("", ["person"]),+ ("content", []),+ ],+)+async def test_extract_entities_rejects_bad_input(content: str, labels: list[str]) -> None:+ with pytest.raises(offload.OffloadError):+ await offload.extract_entities(_FakeOffloadClient(), content=content, labels=labels)+++class _WindowAwareClient:+ """Returns each known phrase present in the window with start/end relative to+ that window, mimicking GLiNER being called per chunk.+ """++ def __init__(self, phrases: list[tuple[str, str]]) -> None:+ self.phrases = phrases+ self.windows_seen: list[str] = []++ async def extract(self, model: str, items: dict[str, str], **kwargs: Any) -> dict[str, Any]:+ text = items["text"]+ self.windows_seen.append(text)+ entities: list[dict[str, Any]] = []+ for phrase, label in self.phrases:+ idx = text.find(phrase)+ while idx != -1:+ entities.append({"text": phrase, "label": label, "start": idx, "end": idx + len(phrase), "score": 0.9})+ idx = text.find(phrase, idx + 1)+ return {"entities": entities}+++async def test_extract_entities_chunks_large_content_and_shifts_offsets() -> None:+ phrase = "Acme Corporation"+ # Past the first window, so it is only found in a later chunk.+ content = ("x" * (offload.EXTRACT_CHUNK_CHARS + 300)) + " " + phrase + " " + ("y" * 200)+ abs_start = content.index(phrase)+ assert abs_start > offload.EXTRACT_CHUNK_CHARS++ client = _WindowAwareClient([(phrase, "organization")])+ result = await offload.extract_entities(client, content=content, labels=["organization"], model="gliner")++ assert len(client.windows_seen) > 1 # actually chunked+ matches = [e for e in result["entities"] if e["text"] == phrase]+ assert len(matches) == 1+ assert matches[0]["start"] == abs_start+ assert matches[0]["end"] == abs_start + len(phrase)+++async def test_extract_entities_dedupes_phrase_in_window_overlap() -> None:+ phrase = "Globex Inc"+ # Inside the overlap region, so it is seen in two adjacent windows.+ pos = offload.EXTRACT_CHUNK_CHARS - offload.EXTRACT_OVERLAP_CHARS + 20+ content = ("x" * pos) + phrase + ("z" * 1000)+ client = _WindowAwareClient([(phrase, "organization")])++ result = await offload.extract_entities(client, content=content, labels=["organization"], model="gliner")++ assert len(client.windows_seen) > 1+ matches = [e for e in result["entities"] if e["text"] == phrase]+ assert len(matches) == 1+ assert matches[0]["start"] == pos+++async def test_redact_pii_chunks_large_content_and_redacts_full_span() -> None:+ ssn = "123-45-6789"+ content = ("x" * (offload.EXTRACT_CHUNK_CHARS + 200)) + " SSN: " + ssn + " end"+ client = _WindowAwareClient([(ssn, "social security number")])++ result = await offload.redact_pii(client, content=content, labels=["social security number"], model="pii")++ assert len(client.windows_seen) > 1+ assert ssn not in result["redacted_text"]+ assert "[SOCIAL_SECURITY_NUMBER_1]" in result["redacted_text"]+ assert result["metadata"]["span_count"] == 1++[email protected]("tool", ["extract", "redact"])+async def test_extraction_rejects_content_over_cap(tool: str) -> None:+ client = _FakeOffloadClient()+ oversized = "z" * (offload.EXTRACT_MAX_CHARS + 1)+ with pytest.raises(offload.OffloadError, match="extraction limit"):+ if tool == "extract":+ await offload.extract_entities(client, content=oversized, labels=["person"], model="g")+ else:+ await offload.redact_pii(client, content=oversized, labels=["person"], model="g")diff --git a/packages/sie_mcp/tests/test_plugin_pack.py b/packages/sie_mcp/tests/test_plugin_pack.pynew file mode 100644index 000000000..dd8eb8a00--- /dev/null+++ b/packages/sie_mcp/tests/test_plugin_pack.py@@ -0,0 +1,162 @@+import io+import zipfile+from pathlib import Path++import pytest+from sie_mcp.plugin_pack import build_plugin_pack, normalize_mcp_url++_SKILL_MD = """---+name: superlinked-docs+description: >-+ Offload document work to the Superlinked inference cluster: convert documents+ to clean markdown instead of ingesting the file directly.+---++# Body+"""++_PARSE_DOCUMENT_SKILL_MD = """---+name: parse-document+description: Parse documents through the Superlinked MCP edge.+---++# Parse+"""++_SUMMARIZE_DOCUMENT_SKILL_MD = """---+name: summarize-document+description: Summarize documents through the Superlinked MCP edge.+---++# Summarize+"""++_EXTRACT_ENTITIES_SKILL_MD = """---+name: extract-entities+description: Extract entities through the Superlinked MCP edge.+---++# Extract+"""++_REDACT_PII_SKILL_MD = """---+name: redact-pii+description: Redact PII through the Superlinked MCP edge.+---++# Redact+"""+++ ("raw", "expected"),+ [+ ("https://mcp.sie-test.example", "https://mcp.sie-test.example/mcp"),+ ("https://mcp.sie-test.example/", "https://mcp.sie-test.example/mcp"),+ ("https://mcp.sie-test.example/mcp/", "https://mcp.sie-test.example/mcp"),+ ("https://mcp.sie-test.example/api/mcp", "https://mcp.sie-test.example/api/mcp"),+ ],+)+def test_normalize_mcp_url(raw: str, expected: str) -> None:+ assert normalize_mcp_url(raw) == expected+++ "raw",+ [+ "",+ "mcp.sie-test.example/mcp",+ "ftp://mcp.sie-test.example/mcp",+ "https://mcp.sie-test.example/not-mcp",+ "https://mcp.sie-test.example/mcp?secret=nope",+ "https://mcp.sie-test.example/mcp#frag",+ ],+)+def test_normalize_mcp_url_rejects_bad_values(raw: str) -> None:+ with pytest.raises(ValueError, match="MCP URL"):+ normalize_mcp_url(raw)+++def test_build_plugin_pack_writes_install_artifacts(tmp_path: Path) -> None:+ connector_secret = "demo-connector-secret" # noqa: S105 - inert test fixture+ report = build_plugin_pack(+ _SKILL_MD,+ mcp_url="https://mcp.sie-test.example",+ connector_secret=connector_secret,+ cluster_label="sie-test",+ claude_code_skill_mds=[+ _EXTRACT_ENTITIES_SKILL_MD,+ _PARSE_DOCUMENT_SKILL_MD,+ _REDACT_PII_SKILL_MD,+ _SUMMARIZE_DOCUMENT_SKILL_MD,+ ],+ cowork_guide_md="# Cowork install\n",+ out_dir=tmp_path,+ )++ assert report.mcp_url == "https://mcp.sie-test.example/mcp"+ assert report.skill_name == "superlinked-docs"+ assert report.skill_zip == tmp_path / "superlinked-docs-skill.zip"+ assert report.claude_code_skill == tmp_path / "claude-code" / "superlinked-docs" / "SKILL.md"+ assert report.claude_code_skills == (+ tmp_path / "claude-code" / "superlinked-docs" / "SKILL.md",+ tmp_path / "claude-code" / "extract-entities" / "SKILL.md",+ tmp_path / "claude-code" / "parse-document" / "SKILL.md",+ tmp_path / "claude-code" / "redact-pii" / "SKILL.md",+ tmp_path / "claude-code" / "summarize-document" / "SKILL.md",+ )+ assert report.cowork_guide == tmp_path / "cowork" / "superlinked.md"+ assert report.install_guide == tmp_path / "INSTALL.md"++ assert report.claude_code_skill.read_text(encoding="utf-8") == _SKILL_MD+ parse_skill = tmp_path / "claude-code" / "parse-document" / "SKILL.md"+ assert parse_skill.read_text(encoding="utf-8") == _PARSE_DOCUMENT_SKILL_MD+ assert report.cowork_guide is not None+ assert report.cowork_guide.read_text(encoding="utf-8") == "# Cowork install\n"++ guide = report.install_guide.read_text(encoding="utf-8")+ assert "https://mcp.sie-test.example/mcp" in guide+ assert "demo-connector-secret" in guide+ assert "claude mcp add --scope user --transport http superlinked-docs" in guide+ assert "cp -R claude-code/* ~/.claude/skills/" in guide+ assert "parse-document" in guide+ assert "summarize-document" in guide+ assert "extract-entities" in guide+ assert "redact-pii" in guide+ assert "PR #1336" in guide+ assert "superlinked-docs-skill.zip" in guide+++def test_build_plugin_pack_keeps_connector_secret_out_of_skill_zip(tmp_path: Path) -> None:+ connector_secret = "secret-that-must-not-enter-the-skill" # noqa: S105 - inert test fixture+ report = build_plugin_pack(+ _SKILL_MD,+ mcp_url="https://mcp.sie-test.example/mcp",+ connector_secret=connector_secret,+ out_dir=tmp_path,+ )++ with zipfile.ZipFile(io.BytesIO(report.skill_zip.read_bytes())) as archive:+ names = archive.namelist()+ skill_text = archive.read("superlinked-docs/SKILL.md").decode()++ assert names == ["superlinked-docs/SKILL.md"]+ assert "secret-that-must-not-enter-the-skill" not in skill_text+++def test_build_plugin_pack_uses_placeholder_when_secret_omitted(tmp_path: Path) -> None:+ report = build_plugin_pack(_SKILL_MD, mcp_url="https://mcp.sie-test.example/mcp", out_dir=tmp_path)++ guide = report.install_guide.read_text(encoding="utf-8")+ assert "Authorization: Bearer <connector-secret>" in guide+++def test_build_plugin_pack_refreshes_claude_code_skills(tmp_path: Path) -> None:+ stale = tmp_path / "claude-code" / "stale" / "SKILL.md"+ stale.parent.mkdir(parents=True)+ stale.write_text("old", encoding="utf-8")++ build_plugin_pack(_SKILL_MD, mcp_url="https://mcp.sie-test.example/mcp", out_dir=tmp_path)++ assert not stale.exists()+ assert (tmp_path / "claude-code" / "superlinked-docs" / "SKILL.md").exists()diff --git a/packages/sie_mcp/tests/test_server.py b/packages/sie_mcp/tests/test_server.pyindex 2795a5d50..47c8cffda 100644--- a/packages/sie_mcp/tests/test_server.py+++ b/packages/sie_mcp/tests/test_server.py@@ -12,7 +12,7 @@ from sie_mcp.config import (DEFAULT_VLOCR_MODEL,MCPConfig,)-from sie_mcp.server import _transport_security+from sie_mcp.server import _resolve_text_input, _transport_securitydef _cfg(**overrides: object) -> MCPConfig:@@ -26,6 +26,8 @@ def _cfg(**overrides: object) -> MCPConfig:"max_image_bytes": DEFAULT_MAX_IMAGE_BYTES,"docling_model": "docling","generate_model": "Qwen/Qwen3.5-4B",+ "extract_model": "urchade/gliner_multi-v2.1",+ "pii_model": "urchade/gliner_multi_pii-v1","max_output_tokens": 4096,"vlocr_model": DEFAULT_VLOCR_MODEL,"encode_model": "BAAI/bge-m3",@@ -35,6 +37,11 @@ def _cfg(**overrides: object) -> MCPConfig:"image_labels": [],"image_top_k": 5,"gpu": None,+ "docs_gpu": None,+ "extract_gpu": None,+ "generate_gpu": None,+ "image_gpu": None,+ "qa_gpu": None,"timeout_s": 300.0,"qa_top_k": 5,"qa_rerank_candidates": 20,@@ -70,3 +77,31 @@ def test_transport_security_scopes_to_allowed_hosts() -> None:}assert ("https", "mcp.example.com") in parsed_originsassert ("http", "mcp.example.com") in parsed_origins+++async def test_resolve_text_input_rejects_plain_content_over_payload_cap() -> None:+ with pytest.raises(ValueError, match="content exceeds 4 bytes"):+ await _resolve_text_input(+ object(),+ _cfg(max_document_bytes=4),+ content="abcde",+ content_base64=None,+ document_base64=None,+ filename=None,+ engine="auto",+ )+++async def test_resolve_text_input_counts_plain_content_as_utf8_bytes() -> None:+ text, metadata = await _resolve_text_input(+ object(),+ _cfg(max_document_bytes=4),+ content="éé",+ content_base64=None,+ document_base64=None,+ filename=None,+ engine="auto",+ )++ assert text == "éé"+ assert metadata == {"input_type": "content"}diff --git a/packages/sie_mcp/tests/test_structured.py b/packages/sie_mcp/tests/test_structured.pyindex 59f1f5ab0..edc97245e 100644--- a/packages/sie_mcp/tests/test_structured.py+++ b/packages/sie_mcp/tests/test_structured.py@@ -233,6 +233,17 @@ async def test_generate_rejects_ebnf_on_outlines_model() -> None:assert client.calls == []+async def test_generate_rejects_ebnf_on_instruct_4b_outlines_model() -> None:+ # The other 4B generation profile on the test cluster is Outlines-backed too.+ client = _FakeChatClient("x")+ rf = {"type": "grammar", "grammar": 'root ::= "yes" | "no"', "syntax": "ebnf"}+ with pytest.raises(StructuredOutputError, match="EBNF"):+ await structured.generate_structured(+ client, prompt="p", response_format=rf, model="Qwen/Qwen3-4B-Instruct-2507"+ )+ assert client.calls == []++async def test_generate_allows_grammar_on_non_outlines_model() -> None:client = _FakeChatClient("yes")rf = {"type": "grammar", "grammar": 'root ::= "yes"', "syntax": "ebnf"}diff --git a/packages/sie_sdk/pyproject.toml b/packages/sie_sdk/pyproject.tomlindex eded1bcb1..04022bf5c 100644--- a/packages/sie_sdk/pyproject.toml+++ b/packages/sie_sdk/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-sdk"-version = "0.6.12"+version = "0.6.13"description = "Search Inference Engine - Python SDK"requires-python = ">=3.12"license = { text = "Apache-2.0" }diff --git a/packages/sie_server/models/Qwen__Qwen3.5-4B.yaml b/packages/sie_server/models/Qwen__Qwen3.5-4B.yamlindex 4b133306a..292cd439e 100644--- a/packages/sie_server/models/Qwen__Qwen3.5-4B.yaml+++ b/packages/sie_server/models/Qwen__Qwen3.5-4B.yaml@@ -260,7 +260,10 @@ profiles:- "--mamba-scheduler-strategy"- "extra_buffer"runtime:- first_chunk_timeout_s: 60+ # Outlines can spend more than 60s compiling/decoding larger+ # json_schema requests before the first visible token. Keep this below+ # overall_timeout_s so genuinely stuck requests still fail within 5 min.+ first_chunk_timeout_s: 180inter_chunk_timeout_s: 10overall_timeout_s: 300default_sampling:diff --git a/packages/sie_server/openapi.json b/packages/sie_server/openapi.jsonindex fff6f38e5..893e5c56b 100644--- a/packages/sie_server/openapi.json+++ b/packages/sie_server/openapi.json@@ -3,7 +3,7 @@"info": {"title": "SIE Server","description": "Search Inference Engine - GPU inference server for search workloads",- "version": "0.6.12"+ "version": "0.6.13"},"paths": {"/": {diff --git a/packages/sie_server/pyproject.toml b/packages/sie_server/pyproject.tomlindex f2ed1f6fb..8dbc7f9cb 100644--- a/packages/sie_server/pyproject.toml+++ b/packages/sie_server/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-server"-version = "0.6.12"+version = "0.6.13"description = "Search Inference Engine - GPU inference server for search workloads"requires-python = ">=3.12,<3.13"license = { text = "Apache-2.0" }diff --git a/packages/sie_server/src/sie_server/api/ws.py b/packages/sie_server/src/sie_server/api/ws.pyindex 88c7abe98..c4db6d017 100644--- a/packages/sie_server/src/sie_server/api/ws.py+++ b/packages/sie_server/src/sie_server/api/ws.py@@ -257,6 +257,14 @@ def _resolved_profile_for_hash(config: ServerModelConfig, profile_name: str) ->return resolve(profile_name, set())+def _is_synthetic_profile_variant(config: ServerModelConfig, configs: dict[str, ServerModelConfig]) -> bool:+ source = config.synthetic_profile_variant_source+ if source is None:+ return False+ base_model, profile = source+ return bool(base_model in configs and profile and config.sie_id == f"{base_model}:{profile}")++def _compute_bundle_config_hash(registry: ModelRegistry, bundle_id: str) -> str:"""Compute SHA-256 hash of model configs assigned to this worker's bundle.@@ -282,6 +290,9 @@ def _compute_bundle_config_hash(registry: ModelRegistry, bundle_id: str) -> str:items = []bundle_adapter_set = _bundle_adapter_modules(bundle_id)for config in sorted(configs.values(), key=lambda c: c.sie_id):+ if _is_synthetic_profile_variant(config, configs):+ continue+profiles_for_hash = []for pname in sorted(config.profiles.keys()):profile_dict = _resolved_profile_for_hash(config, pname)diff --git a/packages/sie_server/src/sie_server/config/model.py b/packages/sie_server/src/sie_server/config/model.pyindex 6e6c1c846..217cadcd5 100644--- a/packages/sie_server/src/sie_server/config/model.py+++ b/packages/sie_server/src/sie_server/config/model.py@@ -436,6 +436,7 @@ class ModelConfig(BaseModel):# Intentionally non-serializable; rebuilt on demand after deserialization._resolved_cache: dict[str, ResolvedProfile] = PrivateAttr(default_factory=dict)_resolved_lock: threading.Lock = PrivateAttr(default_factory=threading.Lock)+ _synthetic_profile_variant_source: tuple[str, str] | None = PrivateAttr(default=None)sie_id: strhf_id: str | None = None@@ -448,6 +449,10 @@ class ModelConfig(BaseModel):max_sequence_length: int | None = Noneprofiles: dict[str, ProfileConfig]+ @property+ def synthetic_profile_variant_source(self) -> tuple[str, str] | None:+ return self._synthetic_profile_variant_source+@model_validator(mode="after")def validate_pool_name(self) -> "ModelConfig":if self.pool is None:diff --git a/packages/sie_server/src/sie_server/core/hot_reload.py b/packages/sie_server/src/sie_server/core/hot_reload.pyindex 6f1c905e0..fc4da0cd2 100644--- a/packages/sie_server/src/sie_server/core/hot_reload.py+++ b/packages/sie_server/src/sie_server/core/hot_reload.py@@ -335,7 +335,7 @@ class HotReloader:)# Register with registry (config_path for flat YAML)- self._registry.add_config(config, config_path)+ await self._registry.add_config_async(config, config_path)logger.info("Added new model: %s", model_name)return ReloadResult(@@ -413,7 +413,7 @@ class HotReloader:# Update registry with new configif model_name in new_configs:- self._registry.add_config(new_configs[model_name], config_path)+ await self._registry.add_config_async(new_configs[model_name], config_path)# Reload model if it was loaded beforeif was_loaded and model_name in new_configs:diff --git a/packages/sie_server/src/sie_server/core/loader.py b/packages/sie_server/src/sie_server/core/loader.pyindex 031dee3d0..82c32d628 100644--- a/packages/sie_server/src/sie_server/core/loader.py+++ b/packages/sie_server/src/sie_server/core/loader.py@@ -6,6 +6,7 @@ import osimport sysimport tempfileimport threading+from collections.abc import Iterable, Mappingfrom pathlib import Pathfrom typing import Any@@ -90,8 +91,22 @@ def _load_configs_from_local(models_dir: Path) -> dict[str, ModelConfig]:logger.exception("Failed to load config from %s", config_path)raise- _expand_profile_variants(configs)- return configs+ return expand_profile_variants(configs)+++def expand_profile_variants(configs: Iterable[ModelConfig] | Mapping[str, ModelConfig]) -> dict[str, ModelConfig]:+ """Return configs plus generated entries for non-default profiles."""+ if isinstance(configs, Mapping):+ expanded = dict(configs)+ else:+ expanded = {}+ for config in configs:+ if config.sie_id in expanded:+ msg = f"duplicate model config: {config.sie_id}"+ raise ValueError(msg)+ expanded[config.sie_id] = config+ _expand_profile_variants(expanded)+ return expandeddef _expand_profile_variants(configs: dict[str, ModelConfig]) -> None:@@ -157,6 +172,7 @@ def _expand_profile_variants(configs: dict[str, ModelConfig]) -> None:# with the base config or sibling variants.variant_config._resolved_cache = {}variant_config._resolved_lock = threading.Lock()+ variant_config._synthetic_profile_variant_source = (base_name, profile_name)variants[variant_id] = variant_configlogger.info("Expanded profile '%s' as variant: %s", profile_name, variant_id)@@ -196,8 +212,7 @@ def _load_configs_from_cloud(models_dir: str) -> dict[str, ModelConfig]:logger.exception("Failed to load config from %s", config_url)raise- _expand_profile_variants(configs)- return configs+ return expand_profile_variants(configs)def load_model_config(config_path: Path) -> ModelConfig:diff --git a/packages/sie_server/src/sie_server/core/registry.py b/packages/sie_server/src/sie_server/core/registry.pyindex dda85ff95..e8635f7a2 100644--- a/packages/sie_server/src/sie_server/core/registry.py+++ b/packages/sie_server/src/sie_server/core/registry.py@@ -33,7 +33,7 @@ from sie_server.core.load_errors import (LoadFailure,classify_load_error,)-from sie_server.core.loader import load_model_configs+from sie_server.core.loader import expand_profile_variants, load_model_configsfrom sie_server.core.memory import MemoryConfig, MemoryManagerfrom sie_server.core.model_loader import DEFAULT_MAX_LORAS, LoadedModel, ModelLoaderfrom sie_server.core.oom import is_oom_error@@ -198,6 +198,7 @@ class ModelRegistry:# Concurrency-safe loadingself._load_lock: asyncio.Lock | None = None # Created lazily on first use+ self._config_update_lock: asyncio.Lock | None = Noneself._loading: set[str] = set() # Models currently being loadedself._unloading: set[str] = set() # Models currently being unloaded# Terminal-failed state. Populated by ``_load_model_background`` when a@@ -585,6 +586,12 @@ class ModelRegistry:self._load_lock = asyncio.Lock()return self._load_lock+ def _get_config_update_lock(self) -> asyncio.Lock:+ """Serialize async config mutations across IPC/hot-reload entrypoints."""+ if self._config_update_lock is None:+ self._config_update_lock = asyncio.Lock()+ return self._config_update_lock+def _check_model_loadable(self, name: str) -> tuple[ModelConfig, Path]:"""Check if a model can be loaded (exists in registry).@@ -1210,7 +1217,7 @@ class ModelRegistry:pool_name=self._pool_name,)- def add_config(self, config: ModelConfig, model_dir: Path | None = None) -> None:+ def add_config(self, config: ModelConfig, model_dir: Path | None = None) -> set[str]:"""Add a model config to the registry.Useful for programmatic config creation without files.@@ -1218,7 +1225,81 @@ class ModelRegistry:Args:config: The model configuration.model_dir: Optional directory for custom adapter resolution.++ Returns:+ Concrete config ids considered by this update, including generated+ profile variants."""+ expanded, updated_ids, removed_ids = self._prepare_config_update(config)+ self._preflight_config_update(expanded, updated_ids, removed_ids)+ if removed_ids:+ removed = ", ".join(sorted(removed_ids))+ msg = f"cannot synchronously remove model config(s): {removed}; use add_config_async"+ raise RuntimeError(msg)+ for expanded_config in expanded.values():+ self._apply_config_entry(expanded_config, model_dir)+ self._loader.update_configs(self._configs)+ return updated_ids | removed_ids++ async def add_config_async(self, config: ModelConfig, model_dir: Path | None = None) -> set[str]:+ """Add a model config, draining removed loaded variants under the load lock."""+ update_lock = self._get_config_update_lock()+ async with update_lock:+ expanded, updated_ids, removed_ids = self._prepare_config_update(config)+ self._preflight_config_update(expanded, updated_ids, removed_ids)+ if removed_ids:+ lock = self._get_load_lock()+ async with lock:+ for model_id in sorted(removed_ids):+ if model_id in self._loaded:+ await self._do_unload(model_id)+ self._drop_config_entry(model_id)+ for expanded_config in expanded.values():+ self._apply_config_entry(expanded_config, model_dir)+ self._loader.update_configs(self._configs)+ return updated_ids | removed_ids++ def _prepare_config_update(self, config: ModelConfig) -> tuple[dict[str, ModelConfig], set[str], set[str]]:+ expanded = expand_profile_variants([config])+ updated_ids = set(expanded)+ removed_ids = self._synthetic_profile_variant_ids_for_base(config.sie_id) - updated_ids+ return expanded, updated_ids, removed_ids++ def _preflight_config_update(+ self,+ expanded: dict[str, ModelConfig],+ updated_ids: set[str],+ removed_ids: set[str],+ ) -> None:+ post_update = {+ name: existing_config+ for name, existing_config in self._configs.items()+ if name not in updated_ids and name not in removed_ids+ }+ for expanded_config in expanded.values():+ if not self.accepts_config_pool(expanded_config):+ post_update.pop(expanded_config.sie_id, None)+ continue+ self._validate_config_entry(expanded_config, post_update)+ post_update[expanded_config.sie_id] = expanded_config++ def _synthetic_profile_variant_ids_for_base(self, base_model_id: str) -> set[str]:+ return {+ name+ for name, existing_config in self._configs.items()+ if existing_config.synthetic_profile_variant_source is not None+ and existing_config.synthetic_profile_variant_source[0] == base_model_id+ }++ def _drop_config_entry(self, model_id: str) -> None:+ self._configs.pop(model_id, None)+ if self._model_filter is not None:+ self._model_filter.discard(model_id)+ self._model_dirs.pop(model_id, None)+ self._failed.pop(model_id, None)+ self._config_version += 1++ def _add_config_entry(self, config: ModelConfig, model_dir: Path | None = None) -> None:if not self.accepts_config_pool(config):if config.sie_id in self._configs:del self._configs[config.sie_id]@@ -1226,6 +1307,10 @@ class ModelRegistry:self._failed.pop(config.sie_id, None)self._config_version += 1return+ self._validate_config_entry(config, self._configs)+ self._apply_config_entry(config, model_dir)++ def _validate_config_entry(self, config: ModelConfig, existing_configs: dict[str, ModelConfig]) -> None:# Pool isolation. Validate before mutating# ``self._configs`` so a rejected add does not leave the# registry in a half-mutated state. ``None`` pool skips the@@ -1235,13 +1320,19 @@ class ModelRegistry:validate_pool_isolation(candidate_name=config.sie_id,candidate_config=config,- existing_configs=self._configs,+ existing_configs=existing_configs,pool_name=self._pool_name,)# Legacy scalar ``lora_id`` exclusion is *not* pool-scoped (it is a# hard invariant) so it fires regardless of ``self._pool_name``.# Multi-LoRA generation (``loadtime.lora_paths``) is unaffected.validate_no_legacy_scalar_lora_id(name=config.sie_id, config=config)++ def _apply_config_entry(self, config: ModelConfig, model_dir: Path | None = None) -> None:+ if not self.accepts_config_pool(config):+ if config.sie_id in self._configs:+ self._drop_config_entry(config.sie_id)+ returnself._configs[config.sie_id] = configif self._model_filter is not None:self._model_filter.add(config.sie_id)@@ -1271,7 +1362,7 @@ class ModelRegistry:disappeared from the authoritative bundle export."""new_configs: dict[str, ModelConfig] = {}- for config in configs:+ for config in expand_profile_variants(configs).values():if not self.accepts_config_pool(config):continueif config.sie_id in new_configs:@@ -1292,36 +1383,38 @@ class ModelRegistry:for name, config in new_configs.items():validate_no_legacy_scalar_lora_id(name=name, config=config)- lock = self._get_load_lock()- async with lock:- removed = set(self._configs) - set(new_configs)- changed = {- name- for name, config in new_configs.items()- if not _model_configs_semantically_equal(self._configs.get(name), config)- }- if model_dir is not None:- changed.update(name for name in new_configs if self._model_dirs.get(name) != model_dir)- invalidated = removed | changed-- if not invalidated:- return set()-- for name in sorted(invalidated):- if name in self._loaded:- await self._do_unload(name)-- self._configs = dict(new_configs)- self._loader.update_configs(self._configs)- if self._model_filter is not None:- self._model_filter = set(new_configs)- self._model_dirs = {name: path for name, path in self._model_dirs.items() if name in new_configs}- if model_dir is not None:- for name in new_configs:- self._model_dirs[name] = model_dir- for name in invalidated:- self._failed.pop(name, None)- self._config_version += 1+ update_lock = self._get_config_update_lock()+ async with update_lock:+ lock = self._get_load_lock()+ async with lock:+ removed = set(self._configs) - set(new_configs)+ changed = {+ name+ for name, config in new_configs.items()+ if not _model_configs_semantically_equal(self._configs.get(name), config)+ }+ if model_dir is not None:+ changed.update(name for name in new_configs if self._model_dirs.get(name) != model_dir)+ invalidated = removed | changed++ if not invalidated:+ return set()++ for name in sorted(invalidated):+ if name in self._loaded:+ await self._do_unload(name)++ self._configs = dict(new_configs)+ self._loader.update_configs(self._configs)+ if self._model_filter is not None:+ self._model_filter = set(new_configs)+ self._model_dirs = {name: path for name, path in self._model_dirs.items() if name in new_configs}+ if model_dir is not None:+ for name in new_configs:+ self._model_dirs[name] = model_dir+ for name in invalidated:+ self._failed.pop(name, None)+ self._config_version += 1# Outside the load lock (``start_load_async`` acquires it): reload pinned# models that were just unloaded because their config changed, and loaddiff --git a/packages/sie_server/src/sie_server/ipc_server.py b/packages/sie_server/src/sie_server/ipc_server.pyindex c2e846c8c..68b8d8218 100644--- a/packages/sie_server/src/sie_server/ipc_server.py+++ b/packages/sie_server/src/sie_server/ipc_server.py@@ -458,7 +458,7 @@ class IpcServer:# full fallback matrix.resp_body = await self._handle_run_batch(msgspec.convert(body, RunBatchRequest))elif method == METHOD_APPLY_MODEL_CONFIG:- resp_body = self._handle_apply_model_config(msgspec.convert(body, ApplyModelConfigRequest))+ resp_body = await self._handle_apply_model_config(msgspec.convert(body, ApplyModelConfigRequest))elif method == METHOD_REPLACE_MODEL_CONFIGS:resp_body = await self._handle_replace_model_configs(msgspec.convert(body, ReplaceModelConfigsRequest))elif method == METHOD_SET_PINNED_MODELS:@@ -558,8 +558,8 @@ class IpcServer:async def _handle_run_batch(self, req: RunBatchRequest) -> BatchOutcome:return await handle_run_batch(self._executor, req)- def _handle_apply_model_config(self, req: ApplyModelConfigRequest) -> ApplyModelConfigResponse:- return self._executor.apply_model_config(req)+ async def _handle_apply_model_config(self, req: ApplyModelConfigRequest) -> ApplyModelConfigResponse:+ return await self._executor.apply_model_config(req)async def _handle_replace_model_configs(self,diff --git a/packages/sie_server/src/sie_server/queue_executor.py b/packages/sie_server/src/sie_server/queue_executor.pyindex 49086ff09..e5096527b 100644--- a/packages/sie_server/src/sie_server/queue_executor.py+++ b/packages/sie_server/src/sie_server/queue_executor.py@@ -502,7 +502,7 @@ class QueueExecutor:"""self._descriptor_cache.pop(model_id, None)- def apply_model_config(self, req: ApplyModelConfigRequest) -> ApplyModelConfigResponse:+ async def apply_model_config(self, req: ApplyModelConfigRequest) -> ApplyModelConfigResponse:"""Validate and add a bundle-scoped config delta to the local registry."""if not req.bundle_id:msg = "bundle_id is required"@@ -521,8 +521,9 @@ class QueueExecutor:msg = f"model_id mismatch: notification={req.model_id!r} config={model_config.sie_id!r}"raise ValueError(msg)- self._registry.add_config(model_config)- self.invalidate_model_descriptor(model_config.sie_id)+ updated_model_ids = await self._registry.add_config_async(model_config)+ for model_id in updated_model_ids:+ self.invalidate_model_descriptor(model_id)bundle_hash = compute_bundle_config_hash_cached(self._registry, req.bundle_id)return ApplyModelConfigResponse(applied=True,diff --git a/packages/sie_server/tests/core/test_hot_reload.py b/packages/sie_server/tests/core/test_hot_reload.pyindex b65d51ca2..10641f91b 100644--- a/packages/sie_server/tests/core/test_hot_reload.py+++ b/packages/sie_server/tests/core/test_hot_reload.py@@ -97,6 +97,7 @@ class TestHotReloader:registry.get_worker.return_value = Noneregistry._configs = {}registry._model_dirs = {}+ registry.add_config_async = AsyncMock() # type: ignore[method-assign]return registry@pytest.fixture@@ -188,6 +189,7 @@ class TestHotReloaderHandlers:registry.get_worker.return_value = Noneregistry._configs = {}registry._model_dirs = {}+ registry.add_config_async = AsyncMock() # type: ignore[method-assign]return registry@pytest.mark.asyncio@@ -227,8 +229,8 @@ class TestHotReloaderHandlers:result = await reloader._handle_model_added(change)assert result.status == ReloadStatus.SUCCESS- mock_registry.add_config.assert_called_once()- call_args = mock_registry.add_config.call_args+ mock_registry.add_config_async.assert_awaited_once()+ call_args = mock_registry.add_config_async.call_argsassert call_args[0][0].name == "new-model"@pytest.mark.asynciodiff --git a/packages/sie_server/tests/test_ipc_server.py b/packages/sie_server/tests/test_ipc_server.pyindex a3d8bd255..59689a6ea 100644--- a/packages/sie_server/tests/test_ipc_server.py+++ b/packages/sie_server/tests/test_ipc_server.py@@ -13,7 +13,9 @@ from unittest.mock import AsyncMock, MagicMock, patchimport msgpackimport numpy as npimport pytest+import yamlfrom sie_server.api.ws import compute_bundle_config_hash_cached+from sie_server.config.model import ModelConfigfrom sie_server.core.inference_output import ExtractOutput, ScoreOutputfrom sie_server.core.registry import ModelRegistryfrom sie_server.core.timing import RequestTiming@@ -125,6 +127,87 @@ def _make_executor() -> tuple[QueueExecutor, MagicMock]:return QueueExecutor(reg), reg+def _qwen_profile_variant_yaml() -> str:+ return """+sie_id: Qwen/Qwen3.6-27B+hf_id: Qwen/Qwen3.6-27B+tasks:+ generate:+ context_length: 4096+ max_output_tokens: 4096+max_sequence_length: 4096+profiles:+ default:+ adapter_path: sie_server.adapters.sglang.generation:SGLangGenerationAdapter+ max_batch_tokens: 16384+ kv_budget_tokens: 8192+ rtx-pro-6000:+ adapter_path: sie_server.adapters.sglang.generation:SGLangGenerationAdapter+ max_batch_tokens: 32768+ kv_budget_tokens: 65536+ adapter_options:+ loadtime:+ max_seq_length: 32768+"""+++def _qwen_default_only_yaml() -> str:+ return """+sie_id: Qwen/Qwen3.6-27B+hf_id: Qwen/Qwen3.6-27B+tasks:+ generate:+ context_length: 4096+ max_output_tokens: 4096+max_sequence_length: 4096+profiles:+ default:+ adapter_path: sie_server.adapters.sglang.generation:SGLangGenerationAdapter+ max_batch_tokens: 16384+ kv_budget_tokens: 8192+"""+++def _qwen_real_colon_config_yaml() -> str:+ return """+sie_id: Qwen/Qwen3.6-27B:rtx-pro-6000+hf_id: Qwen/Qwen3.6-27B+tasks:+ generate:+ context_length: 32768+ max_output_tokens: 4096+max_sequence_length: 32768+profiles:+ default:+ adapter_path: sie_server.adapters.sglang.generation:SGLangGenerationAdapter+ max_batch_tokens: 32768+ kv_budget_tokens: 65536+ adapter_options:+ loadtime:+ max_seq_length: 32768+"""+++def _qwen_invalid_legacy_lora_yaml() -> str:+ return """+sie_id: Qwen/Qwen3.6-27B+hf_id: Qwen/Qwen3.6-27B+tasks:+ generate:+ context_length: 4096+ max_output_tokens: 4096+max_sequence_length: 4096+profiles:+ default:+ adapter_path: sie_server.adapters.sglang.generation:SGLangGenerationAdapter+ max_batch_tokens: 16384+ kv_budget_tokens: 8192+ adapter_options:+ runtime:+ lora_id: legacy-lora+"""++@pytest.fixtureasync def server_and_path():executor, _reg = _make_executor()@@ -285,7 +368,8 @@ class TestEnsureModelReady:class TestApplyModelConfig:- def test_apply_model_config_hash_cache_is_per_registry(self) -> None:+ @pytest.mark.asyncio+ async def test_apply_model_config_hash_cache_is_per_registry(self) -> None:stale_registry = ModelRegistry(models_dir=None)stale_registry._config_version = 1assert compute_bundle_config_hash_cached(stale_registry, "default") == ""@@ -293,7 +377,7 @@ class TestApplyModelConfig:registry = ModelRegistry(models_dir=None, model_filter=["existing/model"])executor = QueueExecutor(registry)- resp = executor.apply_model_config(+ resp = await executor.apply_model_config(ApplyModelConfigRequest(bundle_id="default",model_id="test/model",@@ -361,6 +445,218 @@ profiles:finally:await srv.stop(drain_timeout_s=1.0)+ @pytest.mark.asyncio+ async def test_apply_model_config_expands_profile_variants(self) -> None:+ registry = ModelRegistry(models_dir=None)+ executor = QueueExecutor(registry)+ executor._descriptor_cache["Qwen/Qwen3.6-27B:rtx-pro-6000"] = MagicMock()++ resp = await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id="Qwen/Qwen3.6-27B",+ epoch=7,+ bundle_config_hash="from-sie-config",+ profiles_added=["default", "rtx-pro-6000"],+ model_config=_qwen_profile_variant_yaml(),+ )+ )++ assert resp.applied is True+ assert registry.has_model("Qwen/Qwen3.6-27B")+ assert registry.has_model("Qwen/Qwen3.6-27B:rtx-pro-6000")+ variant = registry.get_config("Qwen/Qwen3.6-27B:rtx-pro-6000")+ assert variant.tasks.generate is not None+ assert variant.tasks.generate.context_length == 32768+ assert variant.max_sequence_length == 32768+ assert "Qwen/Qwen3.6-27B:rtx-pro-6000" not in executor._descriptor_cache++ @pytest.mark.asyncio+ async def test_bundle_hash_ignores_expanded_profile_variant_aliases(self) -> None:+ base_config = ModelConfig(**yaml.safe_load(_qwen_profile_variant_yaml()))+ base_registry = ModelRegistry(models_dir=None, model_filter=["Qwen/Qwen3.6-27B"])+ base_registry._configs[base_config.sie_id] = base_config+ base_registry._config_version += 1+ base_hash = compute_bundle_config_hash_cached(base_registry, "sglang")+ assert base_hash++ expanded_registry = ModelRegistry(models_dir=None)+ executor = QueueExecutor(expanded_registry)+ await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id="Qwen/Qwen3.6-27B",+ epoch=7,+ bundle_config_hash="from-sie-config",+ profiles_added=["default", "rtx-pro-6000"],+ model_config=_qwen_profile_variant_yaml(),+ )+ )++ assert expanded_registry.has_model("Qwen/Qwen3.6-27B:rtx-pro-6000")+ assert compute_bundle_config_hash_cached(expanded_registry, "sglang") == base_hash++ def test_bundle_hash_keeps_real_colon_config(self) -> None:+ base_config = ModelConfig(**yaml.safe_load(_qwen_default_only_yaml()))+ real_colon_config = ModelConfig(**yaml.safe_load(_qwen_real_colon_config_yaml()))+ base_registry = ModelRegistry(models_dir=None)+ base_registry.add_config(base_config)+ base_hash = compute_bundle_config_hash_cached(base_registry, "sglang")+ assert base_hash++ real_colon_registry = ModelRegistry(models_dir=None)+ real_colon_registry.add_config(base_config)+ real_colon_registry.add_config(real_colon_config)++ assert real_colon_config.synthetic_profile_variant_source is None+ assert real_colon_registry.has_model("Qwen/Qwen3.6-27B:rtx-pro-6000")+ assert compute_bundle_config_hash_cached(real_colon_registry, "sglang") != base_hash++ @pytest.mark.asyncio+ async def test_apply_model_config_removes_dropped_profile_variant(self) -> None:+ base_id = "Qwen/Qwen3.6-27B"+ variant_id = "Qwen/Qwen3.6-27B:rtx-pro-6000"+ registry = ModelRegistry(models_dir=None, model_filter=[base_id, variant_id])+ executor = QueueExecutor(registry)++ await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=7,+ bundle_config_hash="from-sie-config",+ profiles_added=["default", "rtx-pro-6000"],+ model_config=_qwen_profile_variant_yaml(),+ )+ )+ assert registry.has_model(variant_id)++ executor._descriptor_cache[variant_id] = MagicMock()+ loaded = MagicMock()+ loaded.worker = None+ loaded.device = "cpu"+ registry._loaded[variant_id] = loaded++ resp = await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=8,+ bundle_config_hash="from-sie-config",+ profiles_added=["default"],+ model_config=_qwen_default_only_yaml(),+ )+ )++ assert resp.applied is True+ assert registry.has_model(base_id)+ assert not registry.has_model(variant_id)+ assert variant_id not in registry._loaded+ assert registry._model_filter == {base_id}+ loaded.adapter.unload.assert_called_once()+ assert variant_id not in executor._descriptor_cache++ @pytest.mark.asyncio+ async def test_apply_model_config_invalid_replacement_keeps_dropped_profile_variant(self) -> None:+ base_id = "Qwen/Qwen3.6-27B"+ variant_id = "Qwen/Qwen3.6-27B:rtx-pro-6000"+ registry = ModelRegistry(models_dir=None, model_filter=[base_id, variant_id])+ executor = QueueExecutor(registry)++ await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=7,+ bundle_config_hash="from-sie-config",+ profiles_added=["default", "rtx-pro-6000"],+ model_config=_qwen_profile_variant_yaml(),+ )+ )+ assert registry.has_model(variant_id)+ executor._descriptor_cache[variant_id] = MagicMock()++ with pytest.raises(ValueError, match="legacy scalar"):+ await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=8,+ bundle_config_hash="from-sie-config",+ profiles_added=["default"],+ model_config=_qwen_invalid_legacy_lora_yaml(),+ )+ )++ assert registry.has_model(base_id)+ assert registry.has_model(variant_id)+ assert registry._model_filter == {base_id, variant_id}+ assert variant_id in executor._descriptor_cache++ @pytest.mark.asyncio+ async def test_apply_model_config_serializes_stale_variant_removal(self) -> None:+ base_id = "Qwen/Qwen3.6-27B"+ variant_id = "Qwen/Qwen3.6-27B:rtx-pro-6000"+ registry = ModelRegistry(models_dir=None, model_filter=[base_id, variant_id])+ executor = QueueExecutor(registry)++ await executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=7,+ bundle_config_hash="from-sie-config",+ profiles_added=["default", "rtx-pro-6000"],+ model_config=_qwen_profile_variant_yaml(),+ )+ )+ assert registry.has_model(variant_id)++ load_lock = registry._get_load_lock()+ await load_lock.acquire()+ remove_task = asyncio.create_task(+ executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=8,+ bundle_config_hash="from-sie-config",+ profiles_added=["default"],+ model_config=_qwen_default_only_yaml(),+ )+ )+ )+ await asyncio.sleep(0)+ assert not remove_task.done()++ readd_task = asyncio.create_task(+ executor.apply_model_config(+ ApplyModelConfigRequest(+ bundle_id="sglang",+ model_id=base_id,+ epoch=9,+ bundle_config_hash="from-sie-config",+ profiles_added=["default", "rtx-pro-6000"],+ model_config=_qwen_profile_variant_yaml(),+ )+ )+ )++ try:+ await asyncio.sleep(0)+ load_lock.release()+ await asyncio.gather(remove_task, readd_task)+ finally:+ if load_lock.locked():+ load_lock.release()+ for task in (remove_task, readd_task):+ if not task.done():+ task.cancel()++ assert registry.has_model(base_id)+ assert registry.has_model(variant_id)+ assert registry._model_filter == {base_id, variant_id}+@pytest.mark.asyncioasync def test_apply_model_config_rejects_model_id_mismatch(self) -> None:registry = ModelRegistry(models_dir=None)@@ -515,6 +811,55 @@ profiles:assert not registry.has_model("stale/model")assert registry.has_model("kept/model")+ @pytest.mark.asyncio+ async def test_replace_model_configs_expands_profile_variants_from_export(self) -> None:+ registry = ModelRegistry(models_dir=None, model_filter=["Qwen/Qwen3.6-27B:rtx-pro-6000"])+ executor = QueueExecutor(registry)++ resp = await executor.replace_model_configs(+ ReplaceModelConfigsRequest(+ bundle_id="sglang",+ epoch=8,+ bundle_config_hash="from-sie-config",+ models=[+ ReplaceModelConfigEntry(+ model_id="Qwen/Qwen3.6-27B",+ model_config=_qwen_profile_variant_yaml(),+ )+ ],+ )+ )++ assert resp.applied is True+ assert resp.applied_models == ["Qwen/Qwen3.6-27B", "Qwen/Qwen3.6-27B:rtx-pro-6000"]+ assert registry.has_model("Qwen/Qwen3.6-27B")+ assert registry.has_model("Qwen/Qwen3.6-27B:rtx-pro-6000")+ assert registry._model_filter == {"Qwen/Qwen3.6-27B", "Qwen/Qwen3.6-27B:rtx-pro-6000"}++ @pytest.mark.asyncio+ async def test_replace_model_configs_rejects_duplicate_export_entries(self) -> None:+ registry = ModelRegistry(models_dir=None)+ executor = QueueExecutor(registry)++ with pytest.raises(ValueError, match="duplicate model config"):+ await executor.replace_model_configs(+ ReplaceModelConfigsRequest(+ bundle_id="sglang",+ epoch=8,+ bundle_config_hash="from-sie-config",+ models=[+ ReplaceModelConfigEntry(+ model_id="Qwen/Qwen3.6-27B",+ model_config=_qwen_profile_variant_yaml(),+ ),+ ReplaceModelConfigEntry(+ model_id="Qwen/Qwen3.6-27B",+ model_config=_qwen_profile_variant_yaml(),+ ),+ ],+ )+ )+@pytest.mark.asyncioasync def test_replace_model_configs_keeps_loaded_model_for_identical_config(self) -> None:registry = ModelRegistry(models_dir=None)diff --git a/packages/sie_server_sidecar/Cargo.lock b/packages/sie_server_sidecar/Cargo.lockindex a172f3a94..8dfc223dd 100644--- a/packages/sie_server_sidecar/Cargo.lock+++ b/packages/sie_server_sidecar/Cargo.lock@@ -2208,7 +2208,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "sie-server-sidecar"-version = "0.6.12"+version = "0.6.13"dependencies = ["anyhow","async-nats",diff --git a/packages/sie_server_sidecar/Cargo.toml b/packages/sie_server_sidecar/Cargo.tomlindex 4b3b92776..ba3780234 100644--- a/packages/sie_server_sidecar/Cargo.toml+++ b/packages/sie_server_sidecar/Cargo.toml@@ -1,6 +1,6 @@[package]name = "sie-server-sidecar"-version = "0.6.12"+version = "0.6.13"edition = "2021"description = "SIE worker sidecar: NATS JetStream consumer, scheduler, IPC client, and GPU-independent prep for sie-server pods."diff --git a/packages/sie_ts_sdk/package.json b/packages/sie_ts_sdk/package.jsonindex 524b974fe..36937cf85 100644--- a/packages/sie_ts_sdk/package.json+++ b/packages/sie_ts_sdk/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-sdk",- "version": "0.6.12",+ "version": "0.6.13","description": "Official TypeScript SDK for SIE (Search Inference Engine)","type": "module","main": "./dist/index.cjs",diff --git a/packages/sie_ts_sdk/src/version.ts b/packages/sie_ts_sdk/src/version.tsindex 71a185022..aabcbb7b3 100644--- a/packages/sie_ts_sdk/src/version.ts+++ b/packages/sie_ts_sdk/src/version.ts@@ -1 +1 @@-export const SDK_VERSION = "0.6.12"; // x-release-please-version+export const SDK_VERSION = "0.6.13"; // x-release-please-versiondiff --git a/uv.lock b/uv.lockindex c05628ee0..1a112728b 100644--- a/uv.lock+++ b/uv.lock@@ -5719,7 +5719,7 @@ dev = [[[package]]name = "sie-admin"-version = "0.6.12"+version = "0.6.13"source = { editable = "packages/sie_admin" }dependencies = [{ name = "httpx" },@@ -5752,7 +5752,7 @@ requires-dist = [[[package]]name = "sie-bench"-version = "0.6.12"+version = "0.6.13"source = { editable = "packages/sie_bench" }dependencies = [{ name = "aiohttp" },@@ -5837,7 +5837,7 @@ requires-dist = [[[package]]name = "sie-chroma"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_chroma" }dependencies = [{ name = "chromadb" },@@ -5909,7 +5909,7 @@ dev = [[[package]]name = "sie-crewai"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_crewai" }dependencies = [{ name = "crewai" },@@ -5934,7 +5934,7 @@ requires-dist = [[[package]]name = "sie-dspy"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_dspy" }dependencies = [{ name = "dspy" },@@ -5959,7 +5959,7 @@ requires-dist = [[[package]]name = "sie-haystack"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_haystack" }dependencies = [{ name = "haystack-ai" },@@ -5986,7 +5986,7 @@ requires-dist = [[[package]]name = "sie-lancedb"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_lancedb" }dependencies = [{ name = "lancedb" },@@ -6013,7 +6013,7 @@ requires-dist = [[[package]]name = "sie-langchain"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_langchain" }dependencies = [{ name = "langchain-core" },@@ -6040,7 +6040,7 @@ requires-dist = [[[package]]name = "sie-llamaindex"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_llamaindex" }dependencies = [{ name = "llama-index-core" },@@ -6106,7 +6106,7 @@ dev = [[[package]]name = "sie-qdrant"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_qdrant" }dependencies = [{ name = "qdrant-client" },@@ -6129,7 +6129,7 @@ requires-dist = [[[package]]name = "sie-sdk"-version = "0.6.12"+version = "0.6.13"source = { editable = "packages/sie_sdk" }dependencies = [{ name = "aiohttp" },@@ -6182,7 +6182,7 @@ requires-dist = [[[package]]name = "sie-server"-version = "0.6.12"+version = "0.6.13"source = { editable = "packages/sie_server" }dependencies = [{ name = "blake3" },@@ -6312,7 +6312,7 @@ requires-dist = [[[package]]name = "sie-weaviate"-version = "0.6.12"+version = "0.6.13"source = { editable = "integrations/sie_weaviate" }dependencies = [{ name = "sie-sdk" },