create-stitchkit 0.6.22 → 0.7.0

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +9 -1
  3. package/UPGRADING.md +84 -16
  4. package/dist/cli.js +83 -56
  5. package/examples/repository/packages/backend/src/surface.snapshot.json +175 -88
  6. package/examples/repository/scripts/runtime-smoke.ts +156 -126
  7. package/package.json +12 -9
  8. package/template/README.md +12 -2
  9. package/template/_gitignore +1 -0
  10. package/template/bun.lock +12 -12
  11. package/template/docs/ADDING_A_FEATURE.md +21 -7
  12. package/template/package.json +5 -5
  13. package/template/packages/backend/package.json +1 -1
  14. package/template/packages/backend/src/cli.ts +1 -0
  15. package/template/packages/backend/src/index.ts +3 -0
  16. package/template/packages/backend/src/lib/live.ts +3 -1
  17. package/template/packages/backend/src/surface.snapshot.json +90 -50
  18. package/template/packages/backend/src/tools.ts +1 -1
  19. package/template/packages/config/package.json +1 -1
  20. package/template/packages/frontend/package.json +2 -2
  21. package/template/packages/shared/package.json +1 -1
  22. package/template/scripts/acceptance-environment.test.ts +59 -0
  23. package/template/scripts/acceptance-environment.ts +52 -0
  24. package/template/scripts/acceptance-local.ts +8 -28
  25. package/template/scripts/runtime-smoke.test.ts +49 -0
  26. package/template/scripts/runtime-smoke.ts +2 -2
  27. package/template/scripts/surface-snapshot.ts +135 -14
  28. package/templates/agent/package.json +7 -7
  29. package/templates/agent/src/runtime.ts +1 -1
  30. package/templates/telegram-bot/package.json +3 -3
  31. package/template/.data/board.sqlite +0 -0
  32. package/template/packages/backend/src/surface-manifest.test.ts +0 -237
  33. package/template/packages/backend/src/surface-manifest.ts +0 -220
  34. package/template/scripts/surface-conformance.ts +0 -173
@@ -1,90 +1,177 @@
1
- [
2
- {
3
- "service": "board",
4
- "action": "list",
5
- "scope": "public",
6
- "hasInput": false,
7
- "hasOutput": true,
8
- "inputShape": null,
9
- "outputShape": "ce49fe198eb3412f",
10
- "http": [
11
- {
12
- "method": "GET",
13
- "path": "/api/board"
14
- }
15
- ],
16
- "tools": {}
17
- },
18
- {
19
- "service": "board",
20
- "action": "post",
21
- "scope": "public",
22
- "hasInput": true,
23
- "hasOutput": true,
24
- "inputShape": "b1d8eb61c62cafed",
25
- "outputShape": "ce49fe198eb3412f",
26
- "http": [
27
- {
28
- "method": "POST",
29
- "path": "/api/board"
30
- }
31
- ],
32
- "tools": {}
33
- },
34
- {
35
- "service": "repository",
36
- "action": "read",
37
- "scope": "public",
38
- "hasInput": false,
39
- "hasOutput": true,
40
- "inputShape": null,
41
- "outputShape": "05d1386c30d82f6a",
42
- "http": [
43
- {
44
- "method": "GET",
45
- "path": "/api/repository"
46
- }
47
- ],
48
- "tools": {
49
- "MCP": "repository_read",
50
- "AGENT": "repository_read",
51
- "CLI": "repository_read"
1
+ {
2
+ "manifestVersion": 3,
3
+ "digestVersion": 1,
4
+ "operations": [
5
+ {
6
+ "kind": "contract",
7
+ "service": "board",
8
+ "action": "list",
9
+ "method": "GET",
10
+ "scope": "public",
11
+ "description": "Read the board",
12
+ "schemas": {
13
+ "params": null,
14
+ "input": null,
15
+ "output": "e486aa374f9a13e0",
16
+ "multipart": null
17
+ },
18
+ "mcp": null,
19
+ "http": [
20
+ {
21
+ "method": "GET",
22
+ "path": "/api/board"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "kind": "contract",
28
+ "service": "board",
29
+ "action": "post",
30
+ "method": "POST",
31
+ "scope": "public",
32
+ "description": "Add a note to the board",
33
+ "schemas": {
34
+ "params": null,
35
+ "input": "c23c53a4b15afe81",
36
+ "output": "e486aa374f9a13e0",
37
+ "multipart": null
38
+ },
39
+ "mcp": null,
40
+ "http": [
41
+ {
42
+ "method": "POST",
43
+ "path": "/api/board"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "kind": "contract",
49
+ "service": "repository",
50
+ "action": "read",
51
+ "method": "GET",
52
+ "scope": "public",
53
+ "description": "Read the server-cached repository snapshot",
54
+ "schemas": {
55
+ "params": null,
56
+ "input": null,
57
+ "output": "5ae5b88ae9390b60",
58
+ "multipart": null
59
+ },
60
+ "mcp": null,
61
+ "http": [
62
+ {
63
+ "method": "GET",
64
+ "path": "/api/repository"
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "kind": "contract",
70
+ "service": "repository",
71
+ "action": "refresh",
72
+ "method": "POST",
73
+ "scope": "public",
74
+ "description": "Refresh the repository snapshot from GitHub",
75
+ "schemas": {
76
+ "params": null,
77
+ "input": null,
78
+ "output": "5ae5b88ae9390b60",
79
+ "multipart": null
80
+ },
81
+ "mcp": null,
82
+ "http": [
83
+ {
84
+ "method": "POST",
85
+ "path": "/api/repository/refresh"
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ "kind": "contract",
91
+ "service": "system",
92
+ "action": "status",
93
+ "method": "GET",
94
+ "scope": "public",
95
+ "description": "Read application readiness",
96
+ "schemas": {
97
+ "params": null,
98
+ "input": null,
99
+ "output": "14a186301eeae875",
100
+ "multipart": null
101
+ },
102
+ "mcp": null,
103
+ "http": [
104
+ {
105
+ "method": "GET",
106
+ "path": "/api/system/status"
107
+ }
108
+ ]
52
109
  }
53
- },
54
- {
55
- "service": "repository",
56
- "action": "refresh",
57
- "scope": "public",
58
- "hasInput": false,
59
- "hasOutput": true,
60
- "inputShape": null,
61
- "outputShape": "05d1386c30d82f6a",
62
- "http": [
63
- {
64
- "method": "POST",
65
- "path": "/api/repository/refresh"
66
- }
67
- ],
68
- "tools": {
69
- "MCP": "repository_refresh",
70
- "AGENT": "repository_refresh",
71
- "CLI": "repository_refresh"
110
+ ],
111
+ "toolSurfaces": [
112
+ {
113
+ "transport": "AGENT",
114
+ "surface": null,
115
+ "tools": [
116
+ {
117
+ "kind": "contract",
118
+ "service": "repository",
119
+ "action": "read",
120
+ "name": "repository_read",
121
+ "input": "7a014b717a77aac9"
122
+ },
123
+ {
124
+ "kind": "contract",
125
+ "service": "repository",
126
+ "action": "refresh",
127
+ "name": "repository_refresh",
128
+ "input": "7a014b717a77aac9"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "transport": "CLI",
134
+ "surface": null,
135
+ "tools": [
136
+ {
137
+ "kind": "contract",
138
+ "service": "repository",
139
+ "action": "read",
140
+ "name": "repository_read",
141
+ "input": "7a014b717a77aac9"
142
+ },
143
+ {
144
+ "kind": "contract",
145
+ "service": "repository",
146
+ "action": "refresh",
147
+ "name": "repository_refresh",
148
+ "input": "7a014b717a77aac9"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "transport": "MCP",
154
+ "surface": null,
155
+ "tools": [
156
+ {
157
+ "kind": "contract",
158
+ "service": "repository",
159
+ "action": "read",
160
+ "name": "repository_read",
161
+ "input": "7a014b717a77aac9"
162
+ },
163
+ {
164
+ "kind": "contract",
165
+ "service": "repository",
166
+ "action": "refresh",
167
+ "name": "repository_refresh",
168
+ "input": "7a014b717a77aac9"
169
+ }
170
+ ]
72
171
  }
73
- },
74
- {
75
- "service": "system",
76
- "action": "status",
77
- "scope": "public",
78
- "hasInput": false,
79
- "hasOutput": true,
80
- "inputShape": null,
81
- "outputShape": "58b078ade3ee6167",
82
- "http": [
83
- {
84
- "method": "GET",
85
- "path": "/api/system/status"
86
- }
87
- ],
88
- "tools": {}
89
- }
90
- ]
172
+ ],
173
+ "realtimeContracts": [],
174
+ "realtime": [],
175
+ "cliOnly": [],
176
+ "extensions": []
177
+ }
@@ -1,8 +1,13 @@
1
1
  import { RepositorySnapshotSchema, repositoryRealtimeContract } from '@app/shared';
2
2
  import { createRealtimeClient, defineRealtimeContract } from 'stitchkit';
3
+ import {
4
+ type RealtimeRejectionObservation,
5
+ runSurfaceProbes,
6
+ type TransportObservation,
7
+ } from 'stitchkit/testing';
3
8
  import { z } from 'zod';
4
9
  import { assertDeploymentIsAnswering } from './deployment-preflight';
5
- import { defineSurfaceProbe, runSurfaceConformance } from './surface-conformance';
10
+ import { assertLiveSurface } from './surface-snapshot';
6
11
  import { loadToolingEnv } from './tooling-env';
7
12
  import { assertArtifactIsPlacementFree, assertPublicWebSurface } from './web-surface-smoke';
8
13
 
@@ -17,7 +22,7 @@ await assertDeploymentIsAnswering({
17
22
  async function json(path: string, init?: RequestInit): Promise<unknown> {
18
23
  const response = await fetch(`${apiOrigin}${path}`, {
19
24
  ...init,
20
- signal: AbortSignal.timeout(30_000),
25
+ signal: init?.signal ?? AbortSignal.timeout(30_000),
21
26
  });
22
27
  if (!response.ok)
23
28
  throw new Error(`${init?.method ?? 'GET'} ${path} returned ${response.status}`);
@@ -26,136 +31,161 @@ async function json(path: string, init?: RequestInit): Promise<unknown> {
26
31
 
27
32
  z.object({ status: z.literal('ok') }).parse(await json('/health'));
28
33
 
29
- await runSurfaceConformance({
30
- apiOrigin,
34
+ await assertLiveSurface(apiOrigin);
35
+
36
+ interface RepositoryProbeFixture {
37
+ path: '/api/repository/refresh';
38
+ mode: 'refresh' | 'divergent-contract';
39
+ }
40
+
41
+ async function runRefreshProbe(
42
+ path: string,
43
+ signal: AbortSignal,
44
+ ): Promise<TransportObservation> {
45
+ const rejected: string[] = [];
46
+ const socket = createRealtimeClient(repositoryRealtimeContract, {
47
+ url: apiOrigin,
48
+ transports: ['websocket'],
49
+ onRejected: ({ event, direction, phase }) => {
50
+ rejected.push(`${event}:${direction}:${phase}`);
51
+ },
52
+ });
53
+ try {
54
+ await new Promise<void>((resolve, reject) => {
55
+ const timeout = setTimeout(
56
+ () => reject(new Error('Socket.IO connection timed out')),
57
+ 5_000,
58
+ );
59
+ const unsubscribe = socket.onConnectionChange((connected, reason) => {
60
+ if (!connected) {
61
+ if (reason) reject(new Error(`Socket.IO disconnected: ${reason}`));
62
+ return;
63
+ }
64
+ clearTimeout(timeout);
65
+ unsubscribe();
66
+ resolve();
67
+ });
68
+ socket.connect();
69
+ });
70
+ const refreshedEvent = new Promise<string>((resolve, reject) => {
71
+ const timeout = setTimeout(
72
+ () => reject(new Error('Socket.IO repository refresh event timed out')),
73
+ 5_000,
74
+ );
75
+ const unsubscribe = socket.on('repository:refreshed', (snapshot) => {
76
+ clearTimeout(timeout);
77
+ unsubscribe();
78
+ resolve(snapshot.fullName);
79
+ });
80
+ });
81
+ const refreshed = RepositorySnapshotSchema.parse(
82
+ await json(path, { method: 'POST', signal }),
83
+ );
84
+ if ((await refreshedEvent) !== refreshed.fullName) {
85
+ throw new Error('Socket.IO repository identity differs');
86
+ }
87
+ const cached = RepositorySnapshotSchema.parse(await json('/api/repository/', { signal }));
88
+ if (cached.fullName !== refreshed.fullName) {
89
+ throw new Error('Repository cache read differs');
90
+ }
91
+ if (rejected.length > 0) {
92
+ throw new Error(`Realtime contract rejected ${rejected.join(', ')}`);
93
+ }
94
+ return { outcome: 'success' };
95
+ } finally {
96
+ socket.disconnect();
97
+ }
98
+ }
99
+
100
+ async function runDivergentContractProbe(
101
+ path: string,
102
+ signal: AbortSignal,
103
+ ): Promise<TransportObservation> {
104
+ // NEGATIVE probe: a client whose local contract disagrees with the
105
+ // server must see the real payload REJECTED — this executes the
106
+ // rejection path instead of merely asserting its absence. Matched by
107
+ // structured rejection observation, never by message text.
108
+ const divergentContract = defineRealtimeContract({
109
+ serverToClient: {
110
+ 'repository:refreshed': { args: z.tuple([z.object({ bogus: z.string() })]) },
111
+ },
112
+ clientToServer: {},
113
+ });
114
+ const rejections: RealtimeRejectionObservation[] = [];
115
+ const socket = createRealtimeClient(divergentContract, {
116
+ url: apiOrigin,
117
+ transports: ['websocket'],
118
+ onRejected: ({ direction, phase, reason, fault }) => {
119
+ rejections.push({ direction, phase, reason, fault });
120
+ },
121
+ });
122
+ try {
123
+ await new Promise<void>((resolve, reject) => {
124
+ const timeout = setTimeout(
125
+ () => reject(new Error('Socket.IO connection timed out')),
126
+ 5_000,
127
+ );
128
+ const unsubscribe = socket.onConnectionChange((connected) => {
129
+ if (!connected) return;
130
+ clearTimeout(timeout);
131
+ unsubscribe();
132
+ resolve();
133
+ });
134
+ socket.connect();
135
+ });
136
+ // A handler must be attached for the inbound frame to be validated.
137
+ const unsubscribe = socket.on('repository:refreshed', () => {
138
+ throw new Error('a payload outside the local contract reached the handler');
139
+ });
140
+ await json(path, { method: 'POST', signal });
141
+ const deadline = Date.now() + 5_000;
142
+ while (rejections.length === 0 && Date.now() < deadline) {
143
+ await new Promise((resolve) => setTimeout(resolve, 50));
144
+ }
145
+ unsubscribe();
146
+ const rejection = rejections[0];
147
+ if (!rejection) {
148
+ throw new Error('the contract mismatch was never rejected');
149
+ }
150
+ return { outcome: 'realtime_rejected', rejection };
151
+ } finally {
152
+ socket.disconnect();
153
+ }
154
+ }
155
+
156
+ await runSurfaceProbes<RepositoryProbeFixture>({
31
157
  probes: [
32
- defineSurfaceProbe({
158
+ {
33
159
  name: 'repository refresh lifecycle',
34
- input: z.object({ path: z.literal('/api/repository/refresh') }),
35
- fixture: { path: '/api/repository/refresh' },
36
- output: RepositorySnapshotSchema,
37
- run: async ({ path }) => {
38
- const rejected: string[] = [];
39
- const socket = createRealtimeClient(repositoryRealtimeContract, {
40
- url: apiOrigin,
41
- transports: ['websocket'],
42
- onRejected: ({ event, direction, phase }) => {
43
- rejected.push(`${event}:${direction}:${phase}`);
44
- },
45
- });
46
- try {
47
- await new Promise<void>((resolve, reject) => {
48
- const timeout = setTimeout(
49
- () => reject(new Error('Socket.IO connection timed out')),
50
- 5_000,
51
- );
52
- const unsubscribe = socket.onConnectionChange((connected, reason) => {
53
- if (!connected) {
54
- if (reason) reject(new Error(`Socket.IO disconnected: ${reason}`));
55
- return;
56
- }
57
- clearTimeout(timeout);
58
- unsubscribe();
59
- resolve();
60
- });
61
- socket.connect();
62
- });
63
- const refreshedEvent = new Promise<string>((resolve, reject) => {
64
- const timeout = setTimeout(
65
- () => reject(new Error('Socket.IO repository refresh event timed out')),
66
- 5_000,
67
- );
68
- const unsubscribe = socket.on('repository:refreshed', (snapshot) => {
69
- clearTimeout(timeout);
70
- unsubscribe();
71
- resolve(snapshot.fullName);
72
- });
73
- });
74
- const refreshed = RepositorySnapshotSchema.parse(
75
- await json(path, { method: 'POST' }),
76
- );
77
- if ((await refreshedEvent) !== refreshed.fullName) {
78
- throw new Error('Socket.IO repository identity differs');
79
- }
80
- const cached = RepositorySnapshotSchema.parse(await json('/api/repository/'));
81
- if (cached.fullName !== refreshed.fullName) {
82
- throw new Error('Repository cache read differs');
83
- }
84
- if (rejected.length > 0) {
85
- throw new Error(`Realtime contract rejected ${rejected.join(', ')}`);
86
- }
87
- return refreshed;
88
- } finally {
89
- socket.disconnect();
90
- }
91
- },
92
- }),
93
- defineSurfaceProbe({
160
+ fixture: { path: '/api/repository/refresh', mode: 'refresh' },
161
+ transports: ['REALTIME'],
162
+ expected: { REALTIME: { outcome: 'success' } },
163
+ },
164
+ {
94
165
  name: 'realtime rejection path fires on a contract mismatch',
95
- input: z.object({ path: z.literal('/api/repository/refresh') }),
96
- fixture: { path: '/api/repository/refresh' },
97
- run: async ({ path }) => {
98
- // NEGATIVE probe: a client whose local contract disagrees with the
99
- // server must see the real payload REJECTED — this executes the
100
- // rejection path instead of merely asserting its absence. Matched by
101
- // event/direction/phase, never by message text.
102
- const divergentContract = defineRealtimeContract({
103
- serverToClient: {
104
- 'repository:refreshed': { args: z.tuple([z.object({ bogus: z.string() })]) },
166
+ fixture: { path: '/api/repository/refresh', mode: 'divergent-contract' },
167
+ transports: ['REALTIME'],
168
+ expected: {
169
+ REALTIME: {
170
+ outcome: 'realtime_rejected',
171
+ rejection: {
172
+ direction: 'client-inbound',
173
+ phase: 'arguments',
174
+ reason: 'invalid-arguments',
175
+ fault: 'peer',
105
176
  },
106
- clientToServer: {},
107
- });
108
- const rejections: Array<{ event: string; direction: string; phase: string }> = [];
109
- const socket = createRealtimeClient(divergentContract, {
110
- url: apiOrigin,
111
- transports: ['websocket'],
112
- onRejected: ({ event, direction, phase }) => {
113
- rejections.push({ event, direction, phase });
114
- },
115
- });
116
- try {
117
- await new Promise<void>((resolve, reject) => {
118
- const timeout = setTimeout(
119
- () => reject(new Error('Socket.IO connection timed out')),
120
- 5_000,
121
- );
122
- const unsubscribe = socket.onConnectionChange((connected) => {
123
- if (!connected) return;
124
- clearTimeout(timeout);
125
- unsubscribe();
126
- resolve();
127
- });
128
- socket.connect();
129
- });
130
- // A handler must be attached for the inbound frame to be validated.
131
- const unsubscribe = socket.on('repository:refreshed', () => {
132
- throw new Error('a payload outside the local contract reached the handler');
133
- });
134
- await json(path, { method: 'POST' });
135
- const deadline = Date.now() + 5_000;
136
- while (rejections.length === 0 && Date.now() < deadline) {
137
- await new Promise((resolve) => setTimeout(resolve, 50));
138
- }
139
- unsubscribe();
140
- const rejection = rejections[0];
141
- if (!rejection) {
142
- throw new Error('the contract mismatch was never rejected');
143
- }
144
- if (
145
- rejection.event !== 'repository:refreshed' ||
146
- rejection.direction !== 'client-inbound' ||
147
- rejection.phase !== 'arguments'
148
- ) {
149
- throw new Error(
150
- `unexpected rejection identity: ${rejection.event}:${rejection.direction}:${rejection.phase}`,
151
- );
152
- }
153
- } finally {
154
- socket.disconnect();
155
- }
177
+ },
156
178
  },
157
- }),
179
+ },
158
180
  ],
181
+ drivers: {
182
+ REALTIME: {
183
+ invoke: (fixture, signal) =>
184
+ fixture.mode === 'refresh'
185
+ ? runRefreshProbe(fixture.path, signal)
186
+ : runDivergentContractProbe(fixture.path, signal),
187
+ },
188
+ },
159
189
  });
160
190
 
161
191
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-stitchkit",
3
- "version": "0.6.22",
3
+ "version": "0.7.0",
4
4
  "description": "Create a production-shaped Stitchkit application",
5
5
  "license": "MIT",
6
6
  "author": "Max Listov <maxlistov@gmail.com>",
@@ -21,6 +21,7 @@
21
21
  "!template/**/.env",
22
22
  "!template/**/.build-stamp.json",
23
23
  "!template/**/node_modules/**",
24
+ "!template/**/.data/**",
24
25
  "!template/**/.next/**",
25
26
  "!template/**/.stitchkit/**",
26
27
  "!template/**/dist/**",
@@ -34,6 +35,7 @@
34
35
  "!templates/**/.env",
35
36
  "!templates/**/.build-stamp.json",
36
37
  "!templates/**/node_modules/**",
38
+ "!templates/**/.data/**",
37
39
  "!templates/**/.next/**",
38
40
  "!templates/**/.stitchkit/**",
39
41
  "!templates/**/dist/**",
@@ -49,6 +51,7 @@
49
51
  "!examples/**/.env",
50
52
  "!examples/**/.build-stamp.json",
51
53
  "!examples/**/node_modules/**",
54
+ "!examples/**/.data/**",
52
55
  "!examples/**/.next/**",
53
56
  "!examples/**/.stitchkit/**",
54
57
  "!examples/**/dist/**",
@@ -69,7 +72,7 @@
69
72
  },
70
73
  "scripts": {
71
74
  "check": "bun x tsc --noEmit",
72
- "test": "bun test ./tests",
75
+ "test": "bun ../../scripts/test-leak-gate.ts --tmpdir -- bun test ./tests",
73
76
  "build": "rm -rf dist && bun build src/cli.ts --outdir dist --target bun --packages external && chmod +x dist/cli.js",
74
77
  "prepublishOnly": "bun run check && bun run test && bun run build"
75
78
  },
@@ -79,17 +82,17 @@
79
82
  },
80
83
  "devDependencies": {
81
84
  "@openrouter/ai-sdk-provider": "^3.1.0",
82
- "@opentui/core": "^0.9.2",
83
- "@opentui/react": "^0.9.2",
84
- "@types/bun": "^1.4.4",
85
+ "@opentui/core": "^0.9.7",
86
+ "@opentui/react": "^0.9.7",
87
+ "@types/bun": "^1.4.5",
85
88
  "@types/react": "^19.3.0",
86
- "ai": "^7.0.173",
89
+ "ai": "^7.0.179",
87
90
  "react": "^19.3.1",
88
- "stitchkit": "0.124.2",
91
+ "stitchkit": "0.127.0",
89
92
  "typescript": "^7.0.2"
90
93
  },
91
94
  "engines": {
92
- "bun": ">=1.2.0"
95
+ "bun": ">=1.4.0"
93
96
  },
94
- "packageManager": "bun@1.4.4"
97
+ "packageManager": "bun@1.4.5"
95
98
  }
@@ -51,7 +51,17 @@ database migrations you add and launches:
51
51
  - OpenAPI: <http://localhost:3211/openapi.json>
52
52
  - MCP: <http://localhost:3211/mcp>
53
53
 
54
- The home page is a compact, domain-free application reference surface.
54
+ The home page carries one reference vertical feature, a notes board, and no
55
+ product of yours. The board is the slice you replace with your first feature:
56
+ `packages/shared/src/{schemas,contracts}/board.ts`, `packages/backend/src/lib/board.ts`,
57
+ `packages/backend/src/transport/board-service.ts`, the live channel in
58
+ `packages/backend/src/lib/live.ts` and `packages/shared/src/contracts/live.ts`,
59
+ `packages/frontend/src/features/board/`, and `BOARD_STORE_PATH` in
60
+ `packages/config/src/variables.ts`. Two checks lean on it: the end-to-end test in
61
+ `e2e/starter.spec.ts` proves the socket by posting a note from one tab to another,
62
+ and `packages/backend/src/surface.snapshot.json` records the board's operations.
63
+ Removing the board without giving the socket another probe leaves the socket
64
+ unproven.
55
65
  Add application features as vertical schema → contract → service → client slices.
56
66
  The exact workflow is in [`docs/ADDING_A_FEATURE.md`](docs/ADDING_A_FEATURE.md),
57
67
  and root [`AGENTS.md`](AGENTS.md) gives coding agents the application boundaries.
@@ -141,7 +151,7 @@ Both read the catalogue or `/openapi.json`, so that deployment needs
141
151
 
142
152
  ## Requirements
143
153
 
144
- - **Bun** and **Node ≥ 22**.
154
+ - **Bun ≥ 1.4** and **Node ≥ 22.3**.
145
155
  - **PostgreSQL** — external infrastructure, in development and production
146
156
  alike. This project owns its schema and migrations, never the database
147
157
  process.
@@ -1,4 +1,5 @@
1
1
  node_modules/
2
+ .data/
2
3
  dist/
3
4
  .next/
4
5
  next-env.d.ts