feat(daemon): add GET /status endpoint (bd-148)

- Add OpStatus operation and StatusResponse type to RPC protocol
- Add workspacePath and dbPath fields to Server struct
- Implement handleStatus() handler with daemon metadata
- Track last activity time with atomic.Value
- Add client.Status() method
- Check for exclusive locks via ShouldSkipDatabase()
- Update all test files to use new NewServer signature
- Add comprehensive status endpoint test

Closes bd-148
This commit is contained in:
Steve Yegge
2025-10-26 17:55:39 -07:00
parent 6bf5c9d2b9
commit 75c959e69c
10 changed files with 203 additions and 43 deletions

View File

@@ -96,7 +96,7 @@ func TestVersionCompatibility(t *testing.T) {
ServerVersion = tt.serverVersion
defer func() { ServerVersion = originalServerVersion }()
server := NewServer(socketPath, store)
server := NewServer(socketPath, store, tmpDir, dbPath)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -187,7 +187,7 @@ func TestHealthCheckIncludesVersionInfo(t *testing.T) {
ServerVersion = testVersion100
ClientVersion = testVersion100
server := NewServer(socketPath, store)
server := NewServer(socketPath, store, tmpDir, dbPath)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -251,7 +251,7 @@ func TestIncompatibleVersionInHealth(t *testing.T) {
ServerVersion = testVersion100
ClientVersion = "2.0.0"
server := NewServer(socketPath, store)
server := NewServer(socketPath, store, tmpDir, dbPath)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -371,7 +371,7 @@ func TestPingAndHealthBypassVersionCheck(t *testing.T) {
ServerVersion = testVersion100
ClientVersion = "2.0.0"
server := NewServer(socketPath, store)
server := NewServer(socketPath, store, tmpDir, dbPath)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -445,7 +445,7 @@ func TestMetricsOperation(t *testing.T) {
ServerVersion = testVersion100
ClientVersion = testVersion100
server := NewServer(socketPath, store)
server := NewServer(socketPath, store, tmpDir, dbPath)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()