Skip to content

Commit 7d3c9ff

Browse files
sgx-labsclaude
andcommitted
Fix bootstrap & vault UX, bump to 0.7.3
Wire session-bootstrap hook (was missing from SessionStart), fix vault precedence so CWD wins over registry default, make `same init` always set the new vault as default, and improve `same status` vault display with active/default markers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 42dd3e5 commit 7d3c9ff

7 files changed

Lines changed: 79 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## v0.7.3 — Bootstrap & Vault UX
4+
5+
### Fixed
6+
7+
- **Session-bootstrap hook not wired**`same init` now installs all 6 hooks including `session-bootstrap`. Previously only 5 of 6 were configured, so session orientation context was never delivered on SessionStart.
8+
- **Wrong vault when CWD is a vault** — vault resolution now checks CWD for vault markers *before* falling back to the registry default. If you're standing in a vault directory, that vault is used regardless of what the registry default is.
9+
- **`same init` didn't set default vault** — running `same init` in a new directory now always sets that vault as the registry default, not just on first-ever init.
10+
- **`same status` vault display unclear** — vault section now shows the active vault prominently with its resolution source (auto-detected from cwd, registry default, --vault flag). Registered vaults list uses `` for active and `*` for default, sorted alphabetically. JSON output now includes all 6 hooks.
11+
12+
---
13+
314
## v0.7.0 — Cross-Vault Federation
415

516
Search across all your vaults from one place. Manage multiple vaults from the CLI. Propagate notes between vaults with privacy guards.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BINARY_NAME := same
22
BUILD_DIR := build
3-
VERSION := 0.7.2
3+
VERSION := 0.7.3
44
LDFLAGS := -ldflags "-s -w -X main.Version=$(VERSION)"
55

66
# CGO is required for sqlite3 + sqlite-vec

cmd/same/status_cmd.go

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"net/http"
77
"os"
88
"path/filepath"
9+
"sort"
910
"strings"
1011
"time"
1112

@@ -133,7 +134,9 @@ func runStatus(jsonOut bool) error {
133134
"context-surfacing",
134135
"decision-extractor",
135136
"handoff-generator",
137+
"feedback-loop",
136138
"staleness-check",
139+
"session-bootstrap",
137140
}
138141
for _, name := range hookNames {
139142
data.Hooks[name] = hookStatus[name]
@@ -260,21 +263,63 @@ func runStatus(jsonOut bool) error {
260263
cli.Dim, cli.Reset)
261264
}
262265

263-
// Vaults
266+
// Vaults — show active vault prominently, then registered list
264267
reg := config.LoadRegistry()
265-
if len(reg.Vaults) > 0 {
266-
cli.Section("Vaults")
267-
fmt.Printf(" Registered: %d vault(s)\n", len(reg.Vaults))
268-
for name, path := range reg.Vaults {
268+
269+
// Determine which registered vault name maps to the active vault path
270+
activeName := ""
271+
for name, path := range reg.Vaults {
272+
if path == vp {
273+
activeName = name
274+
break
275+
}
276+
}
277+
278+
// Determine how the active vault was resolved
279+
activeSource := ""
280+
if config.VaultOverride != "" {
281+
activeSource = "via --vault flag"
282+
} else if cwd, err := os.Getwd(); err == nil && cwd == vp {
283+
activeSource = "auto-detected from cwd"
284+
} else if activeName != "" && activeName == reg.Default {
285+
activeSource = "registry default"
286+
}
287+
288+
cli.Section("Vault")
289+
if activeName != "" {
290+
sourceHint := ""
291+
if activeSource != "" {
292+
sourceHint = fmt.Sprintf(" %s(%s)%s", cli.Dim, activeSource, cli.Reset)
293+
}
294+
fmt.Printf(" Active: %s %s%s\n", activeName, cli.ShortenHome(vp), sourceHint)
295+
} else {
296+
sourceHint := ""
297+
if activeSource != "" {
298+
sourceHint = fmt.Sprintf(" %s(%s)%s", cli.Dim, activeSource, cli.Reset)
299+
}
300+
fmt.Printf(" Active: %s%s\n", cli.ShortenHome(vp), sourceHint)
301+
}
302+
303+
if len(reg.Vaults) > 1 {
304+
cli.Section("Registered Vaults")
305+
// Sort vault names for deterministic output
306+
names := make([]string, 0, len(reg.Vaults))
307+
for name := range reg.Vaults {
308+
names = append(names, name)
309+
}
310+
sort.Strings(names)
311+
312+
for _, name := range names {
313+
path := reg.Vaults[name]
269314
marker := " "
270-
if name == reg.Default {
315+
if name == activeName {
316+
marker = cli.Green + "→ " + cli.Reset
317+
} else if name == reg.Default {
271318
marker = "* "
272319
}
273-
fmt.Printf(" %s%-15s %s\n", marker, name, cli.ShortenHome(path))
274-
}
275-
if reg.Default != "" {
276-
fmt.Printf("\n %s(* = default · use --all to search across vaults)%s\n", cli.Dim, cli.Reset)
320+
fmt.Printf(" %s%-18s %s\n", marker, name, cli.ShortenHome(path))
277321
}
322+
fmt.Printf("\n %s(* = default · → = active · switch with 'same vault default <name>')%s\n", cli.Dim, cli.Reset)
278323
}
279324

280325
// Config

internal/config/config.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -852,15 +852,7 @@ func defaultVaultPath() string {
852852
return VaultOverride
853853
}
854854

855-
// Check registry default
856-
reg := LoadRegistry()
857-
if reg.Default != "" {
858-
if p, ok := reg.Vaults[reg.Default]; ok {
859-
return p
860-
}
861-
}
862-
863-
// Auto-detect: check CWD for any known marker
855+
// Auto-detect: check CWD for any known marker (before registry default)
864856
if cwd, err := os.Getwd(); err == nil {
865857
for _, marker := range VaultMarkers {
866858
if _, err := os.Stat(filepath.Join(cwd, marker)); err == nil {
@@ -869,6 +861,14 @@ func defaultVaultPath() string {
869861
}
870862
}
871863

864+
// Check registry default
865+
reg := LoadRegistry()
866+
if reg.Default != "" {
867+
if p, ok := reg.Vaults[reg.Default]; ok {
868+
return p
869+
}
870+
}
871+
872872
// Walk up from binary location looking for any marker
873873
if exe, err := os.Executable(); err == nil {
874874
dir := filepath.Dir(exe)

internal/setup/hooks.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var hookDefinitions = map[string][]hookEntry{
2626
},
2727
"SessionStart": {
2828
{Matcher: "", Hooks: []hookAction{
29+
{Type: "command", Command: "%s hook session-bootstrap"},
2930
{Type: "command", Command: "%s version --check"},
3031
{Type: "command", Command: "%s hook staleness-check"},
3132
}},

internal/setup/init.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,7 @@ func registerVault(vaultPath string) {
954954
}
955955

956956
reg.Vaults[name] = vaultPath
957-
if reg.Default == "" {
958-
reg.Default = name
959-
}
957+
reg.Default = name
960958
reg.Save()
961959
}
962960

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sgx-labs/same",
3-
"version": "0.7.2",
3+
"version": "0.7.3",
44
"description": "Persistent memory for AI coding agents. Local-first, SQLite + vector search. MCP server with 12 tools.",
55
"homepage": "https://statelessagent.com",
66
"repository": {

0 commit comments

Comments
 (0)