Skip to content

Commit adb7150

Browse files
test(sync): compare deepseek tui shadow parity
DeepSeek TUI is shadow-compared on this branch, so add the shared source-level proof that provider observation matches the existing ParseDeepSeekTUISession output. This keeps the branch review focused on an actual migration surface rather than only provider-local parser tests. Validation: go fmt ./...; go test -tags "fts5" ./internal/parser ./internal/sync -count=1; go vet ./...; git diff --check; ./custom-gcl run --config .golangci.nilaway.yml ./internal/parser/... ./internal/sync/...
1 parent f1d94a1 commit adb7150

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package sync
2+
3+
import (
4+
"context"
5+
"path/filepath"
6+
"testing"
7+
8+
"github.com/stretchr/testify/assert"
9+
"github.com/stretchr/testify/require"
10+
11+
"go.kenn.io/agentsview/internal/parser"
12+
)
13+
14+
func TestObserveProviderSourceMatchesDeepSeekTUILegacyParser(t *testing.T) {
15+
root := t.TempDir()
16+
sourcePath := filepath.Join(root, "session_123.json")
17+
writeProviderShadowSourceFile(t, sourcePath, deepSeekTUIShadowFixture())
18+
19+
provider, ok := parser.NewProvider(parser.AgentDeepSeekTUI, parser.ProviderConfig{
20+
Roots: []string{root},
21+
Machine: "devbox",
22+
})
23+
require.True(t, ok)
24+
sources, err := provider.Discover(context.Background())
25+
require.NoError(t, err)
26+
require.Len(t, sources, 1)
27+
28+
legacySession, legacyMessages, err := parser.ParseDeepSeekTUISession(sourcePath, "devbox")
29+
require.NoError(t, err)
30+
require.NotNil(t, legacySession)
31+
32+
observation, err := ObserveProviderSource(context.Background(), provider, ProviderObserveRequest{
33+
Source: sources[0],
34+
Machine: "devbox",
35+
})
36+
require.NoError(t, err)
37+
require.Len(t, observation.Results, 1)
38+
39+
assert.Equal(t, *legacySession, observation.Results[0].Session)
40+
assert.Equal(t, legacyMessages, observation.Results[0].Messages)
41+
assert.Equal(t, []string{legacySession.ID}, observation.Planned.DataVersionSessionIDs())
42+
assert.Empty(t, observation.Planned.Diagnostics)
43+
}
44+
45+
func deepSeekTUIShadowFixture() string {
46+
return `{
47+
"metadata": {
48+
"id": "session_123",
49+
"title": "Investigate DeepSeek TUI",
50+
"created_at": "2026-06-01T10:00:00Z",
51+
"updated_at": "2026-06-01T10:02:00Z",
52+
"model": "deepseek-chat",
53+
"workspace": "/Users/alice/code/sample-project"
54+
},
55+
"messages": [
56+
{"role": "user", "content": "Inspect server logs", "timestamp": "2026-06-01T10:00:05Z"},
57+
{"role": "assistant", "content": [{"type": "text", "text": "The server failed during startup."}], "timestamp": "2026-06-01T10:00:10Z"}
58+
]
59+
}`
60+
}

0 commit comments

Comments
 (0)