@jhizzard/termdeck 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jhizzard/termdeck",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Browser-based terminal multiplexer with metadata overlays, panel flashback memory recall, and AI-aware session management",
5
5
  "bin": {
6
6
  "termdeck": "./packages/cli/src/index.js"
@@ -78,6 +78,45 @@ create index if not exists memory_relationships_target_idx on memory_relationshi
78
78
 
79
79
  -- ── match_memories helper RPC ─────────────────────────────────────────────
80
80
  -- Used by remember.ts (dedup) and consolidate.ts (cluster seeding).
81
+ --
82
+ -- Sprint 52.1 — signature-drift guard. On long-lived v0.6.x-era installs
83
+ -- (Joshua's petvetbid, Brad's jizzard-brain), match_memories was created by
84
+ -- a prior Mnestra version with a different RETURN-table column shape:
85
+ -- (id, content, metadata, source_type, category, project, created_at, similarity)
86
+ -- vs the canonical:
87
+ -- (id, content, source_type, category, project, metadata, similarity)
88
+ -- Postgres rejects `CREATE OR REPLACE FUNCTION` when the return-table
89
+ -- column list changes — `cannot change return type of existing function`
90
+ -- — and the migration replay throws exit 5. Sprint 51.7 fixed Class M
91
+ -- (DB failure no longer strands hook upgrade) but this drift remained
92
+ -- and was the only blocker keeping `termdeck init --mnestra` from
93
+ -- finishing cleanly on existing v0.6.x installs. Sprint 51.8 fixed
94
+ -- Class N (settings.json wiring lockstep).
95
+ --
96
+ -- The do-block below drops all `public.match_memories` overloads
97
+ -- regardless of arg list, so the subsequent CREATE OR REPLACE always
98
+ -- lands cleanly on greenfield AND existing-drift installs. Idempotent —
99
+ -- on a brand-new project the loop iterates zero times. Scoped to schema
100
+ -- `public` so we never touch a same-named function in another schema.
101
+ -- No CASCADE: dependent objects in plpgsql/SQL function bodies (e.g.
102
+ -- `memory_recall_graph` from migration 010) reference functions by
103
+ -- name and resolve at call time, so the drop-then-recreate pattern is
104
+ -- safe without CASCADE. If a true hard dependency (view, generated
105
+ -- column) ever appears, the DROP fails loud — the right behavior.
106
+
107
+ do $$
108
+ declare
109
+ r record;
110
+ begin
111
+ for r in
112
+ select p.oid::regprocedure as sig
113
+ from pg_proc p
114
+ join pg_namespace n on n.oid = p.pronamespace
115
+ where p.proname = 'match_memories' and n.nspname = 'public'
116
+ loop
117
+ execute 'drop function ' || r.sig::text;
118
+ end loop;
119
+ end $$;
81
120
 
82
121
  create or replace function match_memories (
83
122
  query_embedding vector(1536),