-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprd.json
More file actions
255 lines (255 loc) · 14.6 KB
/
prd.json
File metadata and controls
255 lines (255 loc) · 14.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
{
"project": "SamehadaDB Naming Convention Unification",
"branchName": "ralph/camelcase-refactoring",
"description": "Unify all naming conventions in SamehadaDB to camelCase (lowerCamelCase / PascalCase) per Effective Go standards. Rename snake_case struct members, function parameters, local variables, and constants across the entire codebase while maintaining zero functional degradation.",
"userStories": [
{
"id": "US-001",
"title": "Rename snake_case identifiers in lib/types/ and lib/common/",
"description": "As a developer, I want all identifiers in the foundational types and common packages to follow camelCase so that downstream packages can depend on consistent naming.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/types/ and lib/common/ are renamed to lowerCamelCase (e.g., log_manager → logManager, first_tuple → firstTuple)",
"All exported snake_case identifiers (e.g., Log_manager → LogManager) are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc. (e.g., tableId → tableID, PageId → PageID)",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase (not just these packages)",
"Do NOT modify EnableOnMemStorage in lib/common/config.go — it must remain true",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 1,
"passes": true,
"notes": "Phase 1 — foundational packages imported by nearly everything. Must be done first. When renaming, search the entire codebase for all references to each renamed identifier."
},
{
"id": "US-002",
"title": "Rename snake_case identifiers in lib/errors/ and lib/storage/page/",
"description": "As a developer, I want all identifiers in error definitions and page management to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/errors/ and lib/storage/page/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 2,
"passes": true,
"notes": "Phase 2 — low-level building blocks for storage."
},
{
"id": "US-003",
"title": "Rename snake_case identifiers in lib/storage/disk/ and lib/storage/buffer/",
"description": "As a developer, I want all identifiers in the disk and buffer layers to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/storage/disk/ and lib/storage/buffer/ are renamed to lowerCamelCase (e.g., log_manager → logManager)",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 3,
"passes": true,
"notes": "Phase 3 — disk and buffer layers. Example: BufferPoolManager.log_manager → logManager. See PRD Before/After examples."
},
{
"id": "US-004",
"title": "Rename snake_case identifiers in lib/storage/table/ and lib/storage/tuple/",
"description": "As a developer, I want all identifiers in the table and tuple layers to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/storage/table/ and lib/storage/tuple/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 4,
"passes": true,
"notes": "Phase 4 — table and tuple layers. Depend on page and buffer."
},
{
"id": "US-005",
"title": "Rename snake_case identifiers in lib/storage/access/",
"description": "As a developer, I want all identifiers in the access layer (table heap, transactions, lock management) to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/storage/access/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 5,
"passes": true,
"notes": "Phase 5a — access layer. Split from index due to size. Depends on table, tuple, and buffer."
},
{
"id": "US-006",
"title": "Rename snake_case identifiers in lib/storage/index/",
"description": "As a developer, I want all identifiers in the index implementations to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/storage/index/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 6,
"passes": true,
"notes": "Phase 5b — index layer. Split from access due to size."
},
{
"id": "US-007",
"title": "Rename snake_case identifiers in lib/catalog/",
"description": "As a developer, I want all identifiers in the catalog management package to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/catalog/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase (e.g., Log_manager → LogManager, Lock_manager → LockManager)",
"Acronyms follow Effective Go rules: tableIds → tableIDs, nextTableId → nextTableID, tableIdsMutex → tableIDsMutex",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 7,
"passes": true,
"notes": "Phase 6 — catalog management. See PRD Before/After example for Catalog struct. Exported members Log_manager and Lock_manager affect external consumers."
},
{
"id": "US-008",
"title": "Rename snake_case identifiers in lib/container/ (hash, skip_list, btree)",
"description": "As a developer, I want all identifiers in data structure packages to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/container/hash/, lib/container/skip_list/, and lib/container/btree/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 8,
"passes": true,
"notes": "Phase 7 — data structures. Relatively self-contained."
},
{
"id": "US-009",
"title": "Rename snake_case identifiers in lib/recovery/ and lib/concurrency/",
"description": "As a developer, I want all identifiers in recovery and concurrency control packages to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/recovery/ and lib/concurrency/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 9,
"passes": true,
"notes": "Phase 8 — recovery and concurrency control."
},
{
"id": "US-010",
"title": "Rename snake_case identifiers in lib/parser/ and lib/planner/",
"description": "As a developer, I want all identifiers in the SQL parser and query planner to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/parser/ and lib/planner/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 10,
"passes": true,
"notes": "Phase 9a — frontend packages. Split from execution due to size."
},
{
"id": "US-011",
"title": "Rename snake_case identifiers in lib/execution/",
"description": "As a developer, I want all identifiers in the execution engine (executors, expressions, plans) to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/execution/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 11,
"passes": true,
"notes": "Phase 9b — execution engine. Split from parser/planner due to size."
},
{
"id": "US-012",
"title": "Rename snake_case identifiers in lib/samehada/, lib/materialization/, and lib/testing/",
"description": "As a developer, I want all identifiers in remaining lib packages to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in lib/samehada/, lib/materialization/, and lib/testing/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"All references to renamed identifiers are updated across the ENTIRE codebase",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes",
"cd server && go build -o samehada-db-server main.go succeeds"
],
"priority": 12,
"passes": true,
"notes": "Phase 10 — miscellaneous lib packages."
},
{
"id": "US-013",
"title": "Rename snake_case identifiers in server/",
"description": "As a developer, I want all identifiers in the REST API server to follow camelCase.",
"acceptanceCriteria": [
"All snake_case struct members, function parameters, and local variables in server/ are renamed to lowerCamelCase",
"All exported snake_case identifiers are renamed to PascalCase",
"Acronyms follow Effective Go rules: Id → ID, Url → URL, etc.",
"snake_case constants are renamed to PascalCase",
"cd server && go build -o samehada-db-server main.go succeeds",
"cd lib && go build ./... succeeds",
"cd lib && go test ./... -short passes"
],
"priority": 13,
"passes": true,
"notes": "Phase 11 — final phase. REST API server depends on lib/ packages."
},
{
"id": "US-014",
"title": "Final verification — no snake_case remains and all tests pass",
"description": "As a developer, I want to confirm the entire refactoring is complete with zero functional regression.",
"acceptanceCriteria": [
"Search entire codebase and confirm no snake_case variable names, struct members, or parameter names remain in .go files (exclude vendor/, go.mod, go.sum, and string literals)",
"cd lib && go test ./... -v -short passes with all tests succeeding",
"cd server && go build -o samehada-db-server main.go succeeds",
"EnableOnMemStorage in lib/common/config.go is still true",
"go vet ./... reports no naming-related warnings"
],
"priority": 14,
"passes": true,
"notes": "Final verification story. No code changes expected — just audit and confirm completeness."
}
]
}