pi-vault-mind 0.16.10 → 0.16.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.11 / 0.6.15 — 2026-07-20
4
+
5
+ ### Fixed
6
+
7
+ - **Panel recovery after bridge startup.** A later panel reconciliation now rehydrates the same Queue, Activity, session, collection, pending-edit, and Git metadata that initial controller startup loads, so a bridge that becomes available after the panel mounted no longer leaves those surfaces permanently stale.
8
+ - **Deterministic ReturnVape reset.** `reset-test-vault.sh` verifies the PID and port registered in `.vault-mind/server.json` serve the target vault before terminating and waiting for that runtime. A stale registry cannot signal an unrelated PID. The reset no longer copies local plugin artifacts; BRAT is the only test-vault update path.
9
+
10
+ ### Verification
11
+
12
+ - Added focused regressions for panel metadata recovery after an initial bridge outage, verified runtime termination, and stale-registry safety.
13
+
14
+
3
15
  ## 0.16.10 / 0.6.14 — 2026-07-20
4
16
 
5
17
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-vault-mind",
3
- "version": "0.16.10",
3
+ "version": "0.16.11",
4
4
  "description": "Passive Obsidian vault extension for pi. Watches @agent markers, dispatches forked subagents (Miner, Broadcaster, Heavy-Lifter), stores in LanceDB with vector + FTS + graph. Multi-agent 'Drop & Forget' workflow for the pi agent ecosystem.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,6 +18,50 @@ if [ ! -d "$VAULT" ]; then
18
18
  exit 1
19
19
  fi
20
20
 
21
+ VAULT_REALPATH="$(cd "$VAULT" && pwd -P)"
22
+
23
+ # Stop only the runtime that proves it serves this vault before deleting its
24
+ # discovery record. A stale/reused PID must never be signalled.
25
+ SERVER_STATE="$VAULT/.vault-mind/server.json"
26
+ if [ -f "$SERVER_STATE" ]; then
27
+ SERVER_METADATA="$(node -e 'const fs = require("node:fs"); try { const { pid, port } = JSON.parse(fs.readFileSync(process.argv[1], "utf8")); if (Number.isSafeInteger(pid) && pid > 0 && Number.isSafeInteger(port) && port > 0 && port < 65536) process.stdout.write(`${pid} ${port}`); } catch {}' "$SERVER_STATE")"
28
+ read -r SERVER_PID SERVER_PORT <<< "$SERVER_METADATA"
29
+ if [ -n "${SERVER_PID:-}" ] && [ -n "${SERVER_PORT:-}" ] && kill -0 "$SERVER_PID" 2>/dev/null; then
30
+ if ! command -v lsof >/dev/null 2>&1; then
31
+ echo "ERROR: lsof is required to verify the registered Vault Mind runtime" >&2
32
+ exit 1
33
+ fi
34
+ SERVER_CWD="$(lsof -a -p "$SERVER_PID" -d cwd -Fn 2>/dev/null | grep '^n' | cut -c2- || true)"
35
+ SERVER_PORT_OWNERS="$(lsof -nP -t -iTCP:"$SERVER_PORT" -sTCP:LISTEN 2>/dev/null || true)"
36
+ if [ "$SERVER_CWD" = "$VAULT_REALPATH" ] && printf '%s\n' "$SERVER_PORT_OWNERS" | grep -qx "$SERVER_PID"; then
37
+ echo "Stopping Vault Mind runtime (PID $SERVER_PID)"
38
+ kill -TERM "$SERVER_PID" 2>/dev/null || true
39
+ for _ in {1..20}; do
40
+ if ! kill -0 "$SERVER_PID" 2>/dev/null; then
41
+ break
42
+ fi
43
+ sleep 0.1
44
+ done
45
+ if kill -0 "$SERVER_PID" 2>/dev/null; then
46
+ echo "Force-stopping Vault Mind runtime (PID $SERVER_PID)"
47
+ kill -KILL "$SERVER_PID" 2>/dev/null || true
48
+ for _ in {1..20}; do
49
+ if ! kill -0 "$SERVER_PID" 2>/dev/null; then
50
+ break
51
+ fi
52
+ sleep 0.1
53
+ done
54
+ if kill -0 "$SERVER_PID" 2>/dev/null; then
55
+ echo "ERROR: Vault Mind runtime did not stop (PID $SERVER_PID)" >&2
56
+ exit 1
57
+ fi
58
+ fi
59
+ else
60
+ echo "Ignoring unverified Vault Mind runtime registry"
61
+ fi
62
+ fi
63
+ fi
64
+
21
65
  echo "Resetting vault: $VAULT"
22
66
 
23
67
  # Remove pi-vault-mind state
@@ -30,18 +74,6 @@ rm -rf "$VAULT/.vault-mind"
30
74
  rm -f "$VAULT/.obsidian/plugins/vault-mind/data.json"
31
75
  rm -f "$HOME/.pi/agent/vault-mind.config.json" # remove global config — vault-scoped only
32
76
 
33
- # Update plugin to latest build (if in the pi-vault-mind repo)
34
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
35
- REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
36
- PLUGIN_DIR="$REPO_ROOT/packages/obsidian"
37
- VAULT_PLUGIN="$VAULT/.obsidian/plugins/vault-mind"
38
-
39
- if [ -d "$VAULT_PLUGIN" ] && [ -f "$PLUGIN_DIR/main.js" ]; then
40
- cp "$PLUGIN_DIR/main.js" "$VAULT_PLUGIN/"
41
- cp "$PLUGIN_DIR/manifest.json" "$VAULT_PLUGIN/"
42
- cp "$PLUGIN_DIR/styles.css" "$VAULT_PLUGIN/"
43
- echo "Plugin updated to $(grep '"version"' "$VAULT_PLUGIN/manifest.json" | head -1 | tr -d ' ",' | cut -d: -f2)"
44
- fi
45
77
 
46
78
  echo ""
47
79
  echo "✓ Vault reset complete. State removed:"
@@ -52,6 +84,6 @@ echo " - collections/ (JSONL data)"
52
84
  echo ""
53
85
  echo "Preserved:"
54
86
  echo " - Vault content (notes, folders)"
55
- echo " - .obsidian/ (plugins, themes, settings)"
87
+ echo " - .obsidian/ (plugins, themes, settings; BRAT owns plugin updates)"
56
88
  echo ""
57
- echo "Next: Open vault in Obsidian Vault Mind panel → Setup tab"
89
+ echo "Next: Pull the released plugin through BRAT, then open Vault Mind → Setup tab"