@barivia/barmesh-mcp 0.8.11 → 0.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -92,7 +92,7 @@ is not CFD-entitled (method/prep details are not returned). Contact Barivia to e
92
92
 
93
93
  ### Migration notes
94
94
 
95
- - **Feature-plane divergences (0.8.1):** Mesh jobs write `divergence_kl` / `feature_divergences.json` / `weights.json` (barsom-parallel). These measure association between SOM **component planes** — not mesh-vs-mesh fingerprint SKL/EMD (`KL_ref`, `EMD_*`). Refresh or add Wasserstein via `barmesh_results(action=feature_divergences)`.
95
+ - **Feature-plane divergences (0.8.1):** Mesh jobs write `divergence_kl` (directed KL heatmap) / `feature_divergences.json` / `weights.json` (barsom-parallel). These measure association between SOM **component planes** — not mesh-vs-mesh fingerprint SKL/EMD (`KL_ref`, `EMD_*`). Refresh or add Wasserstein via `barmesh_results(action=feature_divergences)`.
96
96
  - **UI delivery + mesh_order (0.7.3+ / 0.8.0 / 0.8.10+):** App tools emit structured `ui_delivery` and **always put the standalone viz URL first** (hosts may advertise MCP Apps without mounting widgets). Env: `BARIVIA_UI_DELIVERY` (`auto` \| `apps` \| `localhost` \| `inline` \| `text_only`), `BARIVIA_UI_PREFER_LOCALHOST=1` (opt-in localhost under `auto`), `BARIVIA_VIZ_PORT`. Default mesh_order interleaves U/G at tied cell counts; Richardson warns on mixed topology families.
97
97
  - **Fixed-panel live TE (0.6.3 / barsom 0.20.4):** mid-training TE uses a fixed evaluation panel (`te_panel_size`; `te_inner_samples` alias). Curves stay on panel TE; monitors show **Panel TE** and **Map TE** separately — no snap-to-map on the curve tail.
98
98
  - **`barmesh_training_monitor` (0.5.3):** server-side blocking monitor with throttled snapshots — preferred after job submit instead of manual `barmesh_jobs(status)` loops. Equivalent to `barmesh_jobs(action=monitor)`.
package/dist/shared.js CHANGED
@@ -62,7 +62,7 @@ function newRequestId() {
62
62
  return randomUUID();
63
63
  }
64
64
  /** Single source of truth for the proxy version. Keep in sync with package.json on bump. */
65
- export const CLIENT_VERSION = "0.8.11";
65
+ export const CLIENT_VERSION = "0.8.13";
66
66
  export const PUBLIC_SITE_ORIGIN = "https://barivia.se";
67
67
  /** Large per-cell CSV uploads may exceed the default fetch timeout. */
68
68
  export const UPLOAD_DATASET_TIMEOUT_MS = 180_000;
@@ -948,7 +948,7 @@ export function getCaptionForImage(filename) {
948
948
  if (base === "KL_asymmetric")
949
949
  return "Asymmetric pairwise mesh-fingerprint KL D_KL(P‖Q): above-diagonal cells are coarse→fine, below-diagonal are fine→coarse (meshes ordered coarse→fine). Use when SKL line plots hide directional disagreement.";
950
950
  if (base === "divergence_kl")
951
- return "Feature-plane symmetric KL heatmap (min-shift sum-normalized physical component planes). Measures association between SOM features — not mesh-vs-mesh fingerprint KL (see KL_ref / KL_asymmetric).";
951
+ return "Feature-plane directed KL heatmap (cell (i,j)=KL(pᵢ‖pⱼ); upper/lower triangles opposite directions; min-shift sum-normalized physical component planes). Measures association between SOM features — not mesh-vs-mesh fingerprint KL (see KL_ref / KL_asymmetric).";
952
952
  if (base === "divergence_w1")
953
953
  return "Feature-plane 1-Wasserstein heatmap on the same physical component-plane masses. Opt-in via barmesh_results(action=feature_divergences, metrics=[\"wasserstein\"]).";
954
954
  if (base === "plot_vol_all_meshes")
@@ -43,7 +43,7 @@ function labelForFigure(filename) {
43
43
  if (base === "KL_asymmetric")
44
44
  return "Asymmetric mesh KL matrix (coarse↔fine)";
45
45
  if (base === "divergence_kl")
46
- return "Feature-plane symmetric KL (not mesh KL)";
46
+ return "Feature-plane directed KL (not mesh KL)";
47
47
  if (base === "divergence_w1")
48
48
  return "Feature-plane Wasserstein-1";
49
49
  if (base === "plot_vol_all_meshes")
@@ -45,7 +45,7 @@ function formatMeshResultsSummary(jobId, data, summary) {
45
45
  curveNote,
46
46
  "\nAdvisory: SOM distances complement, not replace, numerical uncertainty analysis (use barmesh_richardson for classical GCI).",
47
47
  topDivLine || klComplexityLine
48
- ? "Feature-plane KL (divergence_kl / feature_divergences.json) measures association between SOM component planes; mesh SKL/EMD measure fingerprint distance between meshes. Refresh or add W1 via barmesh_results(action=feature_divergences, metrics=[\"wasserstein\"])."
48
+ ? "Feature-plane KL: divergence_kl.png is directed (cell (i,j)=KL(pᵢ‖pⱼ); triangles encode direction); feature_divergences.json has directed_kl + symmetric_kl. Mesh SKL/EMD measure fingerprint distance between meshes. Refresh or add W1 via barmesh_results(action=feature_divergences, metrics=[\"wasserstein\"])."
49
49
  : "",
50
50
  "For every figure: barmesh_results_explorer(job_id) or barmesh_results(action=download). Use figures=\"none\" to skip inline images.",
51
51
  ].filter(Boolean).join("\n");
@@ -74,7 +74,7 @@ export function registerResultsTool(server) {
74
74
 
75
75
  BEST FOR: After barmesh_jobs(action=status) shows completed (and finalize finished if defer_figures was used).
76
76
  FIGURES: Default bundle is combined.png, overview_distances.png (all KL/EMD panels), plot_vol_all_meshes.png, plot_vol_steps.png, and learning_curve.png — not redundant per-feature PNGs or divergence_kl. Prefer string figures="all" / "none" (not an array); arrays are for specific base names or filenames. Hosts that stringify arrays are coerced. action=get inlines the headline set; pass figures="all" for every artifact listed in summary.files, figures="none" for metrics only (recommended for agents).
77
- FEATURE-PLANE KL: mesh SKL/EMD (KL_ref, EMD_*) compare meshes; divergence_kl / feature_divergences.json compare SOM component planes (barsom-parallel). Finalize already writes symmetric KL; use action=feature_divergences for W1 or a refresh.
77
+ FEATURE-PLANE KL: mesh SKL/EMD (KL_ref, EMD_*) compare meshes; divergence_kl / feature_divergences.json compare SOM component planes (barsom-parallel). Finalize already writes directed KL heatmap (upper/lower triangles = opposite directions) plus SKL tops in JSON; use action=feature_divergences for W1 or a refresh.
78
78
  PDFs ON DEMAND: vector PDFs are not produced by default. Use action=render (format=pdf) once, then action=image or action=download.
79
79
  If GET /v1/results returns 404 shortly after status=completed, cfd_finalize may still be rendering — poll barmesh_jobs(status) until finalize_job_id completes.
80
80
  UNAVAILABLE: If the mesh analysis API is temporarily unavailable, say so plainly and suggest retry later (~retry_after_sec). Figures already downloaded stay usable.
@@ -124,19 +124,19 @@ NOT FOR: Submitting jobs.`, {
124
124
  const topW1 = sum.top_wasserstein ?? null;
125
125
  const lines = [
126
126
  `Feature-plane divergences complete — job_id: ${newJobId} (parent mesh job: ${job_id})`,
127
- `Method: ${sum.divergence_method ?? "symmetric_kl_min_shift_sum_norm_denormalized_component_planes"}`,
127
+ `Method: ${sum.divergence_method ?? "kl_min_shift_sum_norm_denormalized_component_planes"}`,
128
128
  `Weight space: ${sum.weight_space ?? "denormalized"} (physical component planes)`,
129
129
  `Metrics: ${JSON.stringify(sum.metrics ?? body.metrics)}`,
130
130
  topDivs.length
131
131
  ? `Top symmetric KL pairs: ${topDivs.map((t) => `${t.f1}&${t.f2}=${typeof t.symmetric_kl === "number" ? Number(t.symmetric_kl).toFixed(3) : t.symmetric_kl}`).join(", ")}`
132
132
  : "",
133
133
  klComp.length
134
- ? `KL complexity ranking: ${klComp.map((t) => `${t.feature}=${typeof t.mean_outgoing_kl === "number" ? Number(t.mean_outgoing_kl).toFixed(3) : t.mean_outgoing_kl}`).join(", ")}`
134
+ ? `KL complexity ranking (mean outgoing directed KL): ${klComp.map((t) => `${t.feature}=${typeof t.mean_outgoing_kl === "number" ? Number(t.mean_outgoing_kl).toFixed(3) : t.mean_outgoing_kl}`).join(", ")}`
135
135
  : "",
136
136
  topW1 && topW1.length
137
137
  ? `Top Wasserstein pairs: ${topW1.map((t) => `${t.f1}&${t.f2}=${typeof t.wasserstein === "number" ? Number(t.wasserstein).toFixed(3) : t.wasserstein}`).join(", ")}`
138
138
  : "",
139
- `Artifacts refreshed on parent result (divergence_kl / feature_divergences.json). This is feature-plane association — distinct from mesh fingerprint SKL/EMD (KL_ref, EMD_*).`,
139
+ `Artifacts refreshed on parent result (divergence_kl = directed KL heatmap; feature_divergences.json has directed_kl + symmetric_kl). Feature-plane association — distinct from mesh fingerprint SKL/EMD (KL_ref, EMD_*).`,
140
140
  ].filter(Boolean);
141
141
  const content = [{ type: "text", text: lines.join("\n") }];
142
142
  const files = sum.files ?? [];