Skip to content

Commit eeb24f8

Browse files
committed
fix(test): keep the shared snapshots fixture byte-identical across app and server
`snapshots.json` is duplicated in app/ and server/ and CI (`fixture-sync`) asserts the two copies are byte-identical. The merge resolved only the server copy — the conflicted one — so the app copy silently kept main's version with no SPEC-46 lineage, and the two diverged in both content and formatting. Takes main's compact one-line layout for both, with D10's `parentId` / `handoffReason` / `origin` added to `s1`, and writes the same bytes to each. The lineage fields have to be in the shared fixture rather than a server-only one: the point of the contract pair is that the Dart codec and the TS protocol are tested against the same wire, which is what stops the app and server projections drifting when a field is added. Verified: server protocol contract 16/16, app `codec_contract_test.dart` 12/12, `diff -q` between the two copies is clean.
1 parent c866c25 commit eeb24f8

2 files changed

Lines changed: 4 additions & 107 deletions

File tree

app/test/fixtures/snapshots.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[
22
{ "v": 1, "t": "event", "id": "snap1", "kind": "projects.snapshot", "projects": [ { "id": "p1", "name": "makit", "path": "/repo/makit", "pinned": true, "lastActivityAt": 1000 } ] },
3-
{ "v": 1, "t": "event", "id": "snap2", "kind": "sessions.snapshot", "sessions": [ { "id": "s1", "projectId": "p1", "agent": "pi", "title": "work", "status": "running", "policy": "ask-on-risky", "lastActivityAt": 2000, "lastPreview": "hi" } ] },
3+
{ "v": 1, "t": "event", "id": "snap2", "kind": "sessions.snapshot", "sessions": [ { "id": "s1", "projectId": "p1", "agent": "pi", "title": "work", "status": "running", "policy": "ask-on-risky", "lastActivityAt": 2000, "lastPreview": "hi", "parentId": "s0", "handoffReason": "out of context", "origin": "cli" } ] },
44
{ "v": 1, "t": "event", "id": "snap3", "kind": "ports.snapshot", "snapshot": { "ports": [ { "key": "48211:127.0.0.1:5173", "port": 5173, "address": "127.0.0.1", "reach": "loopback", "pid": 48211, "command": "node vite --port 5173", "startedAt": 1000, "worktreePath": "/repo/makit-wt", "sessionId": "s1", "health": { "kind": "ok", "status": 200, "probedAt": 2000 }, "openUrl": "http://127.0.0.1:5173" }, { "key": "51002:127.0.0.1:5180", "port": 5180, "address": "127.0.0.1", "reach": "loopback", "pid": 51002, "command": "node vite --port 5180", "startedAt": 900, "orphan": { "formerBranch": "feat/desktop-tabs", "formerWorktreePath": "/repo/makit-gone", "removedAt": 2500 } }, { "key": "48300:127.0.0.1:5174", "port": 5174, "address": "127.0.0.1", "reach": "loopback", "pid": 48300, "command": "node vite --port 5174", "startedAt": 950, "worktreePath": "/repo/makit-wt", "collision": { "withBranch": "chore/deps", "withWorktreePath": "/repo/makit-deps" } }, { "key": "901:0.0.0.0:5432", "port": 5432, "address": "0.0.0.0", "reach": "exposed", "pid": 901, "command": "com.docker.backend", "startedAt": 800, "docker": { "container": "chat-ui-db-1", "compose": "/repo/chat-ui/compose.yml" } } ], "scannedAt": 3000, "scanOk": true } }
55
]
Lines changed: 3 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,5 @@
11
[
2-
{
3-
"v": 1,
4-
"t": "event",
5-
"id": "snap1",
6-
"kind": "projects.snapshot",
7-
"projects": [
8-
{
9-
"id": "p1",
10-
"name": "makit",
11-
"path": "/repo/makit",
12-
"pinned": true,
13-
"lastActivityAt": 1000
14-
}
15-
]
16-
},
17-
{
18-
"v": 1,
19-
"t": "event",
20-
"id": "snap2",
21-
"kind": "sessions.snapshot",
22-
"sessions": [
23-
{
24-
"id": "s1",
25-
"projectId": "p1",
26-
"agent": "pi",
27-
"title": "work",
28-
"status": "running",
29-
"policy": "ask-on-risky",
30-
"lastActivityAt": 2000,
31-
"lastPreview": "hi",
32-
"parentId": "s0",
33-
"handoffReason": "out of context",
34-
"origin": "cli"
35-
}
36-
]
37-
},
38-
{
39-
"v": 1,
40-
"t": "event",
41-
"id": "snap3",
42-
"kind": "ports.snapshot",
43-
"snapshot": {
44-
"ports": [
45-
{
46-
"key": "48211:127.0.0.1:5173",
47-
"port": 5173,
48-
"address": "127.0.0.1",
49-
"reach": "loopback",
50-
"pid": 48211,
51-
"command": "node vite --port 5173",
52-
"startedAt": 1000,
53-
"worktreePath": "/repo/makit-wt",
54-
"sessionId": "s1",
55-
"health": {
56-
"kind": "ok",
57-
"status": 200,
58-
"probedAt": 2000
59-
},
60-
"openUrl": "http://127.0.0.1:5173"
61-
},
62-
{
63-
"key": "51002:127.0.0.1:5180",
64-
"port": 5180,
65-
"address": "127.0.0.1",
66-
"reach": "loopback",
67-
"pid": 51002,
68-
"command": "node vite --port 5180",
69-
"startedAt": 900,
70-
"orphan": {
71-
"formerBranch": "feat/desktop-tabs",
72-
"formerWorktreePath": "/repo/makit-gone",
73-
"removedAt": 2500
74-
}
75-
},
76-
{
77-
"key": "48300:127.0.0.1:5174",
78-
"port": 5174,
79-
"address": "127.0.0.1",
80-
"reach": "loopback",
81-
"pid": 48300,
82-
"command": "node vite --port 5174",
83-
"startedAt": 950,
84-
"worktreePath": "/repo/makit-wt",
85-
"collision": {
86-
"withBranch": "chore/deps",
87-
"withWorktreePath": "/repo/makit-deps"
88-
}
89-
},
90-
{
91-
"key": "901:0.0.0.0:5432",
92-
"port": 5432,
93-
"address": "0.0.0.0",
94-
"reach": "exposed",
95-
"pid": 901,
96-
"command": "com.docker.backend",
97-
"startedAt": 800,
98-
"docker": {
99-
"container": "chat-ui-db-1",
100-
"compose": "/repo/chat-ui/compose.yml"
101-
}
102-
}
103-
],
104-
"scannedAt": 3000,
105-
"scanOk": true
106-
}
107-
}
2+
{ "v": 1, "t": "event", "id": "snap1", "kind": "projects.snapshot", "projects": [ { "id": "p1", "name": "makit", "path": "/repo/makit", "pinned": true, "lastActivityAt": 1000 } ] },
3+
{ "v": 1, "t": "event", "id": "snap2", "kind": "sessions.snapshot", "sessions": [ { "id": "s1", "projectId": "p1", "agent": "pi", "title": "work", "status": "running", "policy": "ask-on-risky", "lastActivityAt": 2000, "lastPreview": "hi", "parentId": "s0", "handoffReason": "out of context", "origin": "cli" } ] },
4+
{ "v": 1, "t": "event", "id": "snap3", "kind": "ports.snapshot", "snapshot": { "ports": [ { "key": "48211:127.0.0.1:5173", "port": 5173, "address": "127.0.0.1", "reach": "loopback", "pid": 48211, "command": "node vite --port 5173", "startedAt": 1000, "worktreePath": "/repo/makit-wt", "sessionId": "s1", "health": { "kind": "ok", "status": 200, "probedAt": 2000 }, "openUrl": "http://127.0.0.1:5173" }, { "key": "51002:127.0.0.1:5180", "port": 5180, "address": "127.0.0.1", "reach": "loopback", "pid": 51002, "command": "node vite --port 5180", "startedAt": 900, "orphan": { "formerBranch": "feat/desktop-tabs", "formerWorktreePath": "/repo/makit-gone", "removedAt": 2500 } }, { "key": "48300:127.0.0.1:5174", "port": 5174, "address": "127.0.0.1", "reach": "loopback", "pid": 48300, "command": "node vite --port 5174", "startedAt": 950, "worktreePath": "/repo/makit-wt", "collision": { "withBranch": "chore/deps", "withWorktreePath": "/repo/makit-deps" } }, { "key": "901:0.0.0.0:5432", "port": 5432, "address": "0.0.0.0", "reach": "exposed", "pid": 901, "command": "com.docker.backend", "startedAt": 800, "docker": { "container": "chat-ui-db-1", "compose": "/repo/chat-ui/compose.yml" } } ], "scannedAt": 3000, "scanOk": true } }
1085
]

0 commit comments

Comments
 (0)