Skip to content

Commit 60a540b

Browse files
d-csclaude
andcommitted
chore(run-ops split): strip review-scaffolding comments/labels from pr09 presenters
Comment/label hygiene pass over the PR09 presenter read-routing work. No product logic, assertions, seeds, or test structure changed — only comment text and test/it titles. - Remove the SPLIT-NEUTRAL scaffolding comment on TaskDetailPresenter.getActivity. - Drop `// --- ... ---` comment fencing across the touched test files, keeping the behavioral text. - Strip Task/Step enumeration prefixes from comments and it/test titles, keeping the behavioral descriptions. - Remove Definition-of-Done ("DoD") framing and RED/GREEN TDD phase commentary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 985e97e commit 60a540b

11 files changed

Lines changed: 57 additions & 61 deletions

apps/webapp/app/presenters/v3/TaskDetailPresenter.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ export class TaskDetailPresenter {
141141
};
142142
}
143143

144-
// SPLIT-NEUTRAL: served entirely from ClickHouse (task_runs_v2);
145-
// no run-ops Postgres read — single-DB behavior is n-a, RoutingRunStore is not involved.
146144
async getActivity({
147145
organizationId,
148146
projectId,

apps/webapp/test/SpanPresenter.readthrough.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ function asReplica(prisma: PrismaClient): PrismaClient {
208208
}
209209

210210
describe("SpanPresenter run-ops/control-plane partition (legacy + new)", () => {
211-
// --- Span detail resolves run + children through the run-ops store, region/schedule/session
212-
// on control-plane, no cross-DB join. ---
211+
// Span detail resolves run + children through the run-ops store, region/schedule/session
212+
// on control-plane, no cross-DB join.
213213
heteroPostgresTest(
214214
"findRun hydrates the run through the run-ops store (new-first) and the children-by-parentSpanId set; region/schedule/session resolve from the control-plane client",
215215
async ({ prisma14, prisma17 }) => {
@@ -297,7 +297,7 @@ describe("SpanPresenter run-ops/control-plane partition (legacy + new)", () => {
297297
}
298298
);
299299

300-
// --- Children set served by runStore.findRuns through the routing store ---
300+
// Children set served by runStore.findRuns through the routing store.
301301
heteroPostgresTest(
302302
"triggeredRuns (children-by-parentSpanId) is served by runStore.findRuns with the presenter's exact select",
303303
async ({ prisma14, prisma17 }) => {
@@ -344,7 +344,7 @@ describe("SpanPresenter run-ops/control-plane partition (legacy + new)", () => {
344344
}
345345
);
346346

347-
// --- Old in-retention run served from the legacy replica, never the primary ---
347+
// Old in-retention run served from the legacy replica, never the primary.
348348
heteroPostgresTest(
349349
"a legacy-residency run resolves through the store's LEGACY slot, which exposes only a replica handle",
350350
async ({ prisma14, prisma17 }) => {
@@ -377,7 +377,7 @@ describe("SpanPresenter run-ops/control-plane partition (legacy + new)", () => {
377377
}
378378
);
379379

380-
// --- A known-migrated run is not re-probed on legacy ---
380+
// A known-migrated run is not re-probed on legacy.
381381
heteroPostgresTest(
382382
"a NEW-residency id is served by the NEW slot and the LEGACY slot is never invoked",
383383
async ({ prisma14, prisma17 }) => {
@@ -417,7 +417,7 @@ describe("SpanPresenter run-ops/control-plane partition (legacy + new)", () => {
417417
}
418418
);
419419

420-
// --- Passthrough (single-DB): NEW and LEGACY slots are the same store over one client ---
420+
// Passthrough (single-DB): NEW and LEGACY slots are the same store over one client.
421421
heteroPostgresTest(
422422
"single-DB collapses both slots to one PostgresRunStore; the presenter resolves run + children + control-plane from the one client",
423423
async ({ prisma14 }) => {
@@ -484,7 +484,7 @@ describe("SpanPresenter run-ops/control-plane partition (legacy + new)", () => {
484484
}
485485
);
486486

487-
// --- Cross-seam tree shape: parent on LEGACY (in-retention), child on NEW (born-new) ---
487+
// Cross-seam tree shape: parent on LEGACY (in-retention), child on NEW (born-new).
488488
heteroPostgresTest(
489489
"parent run on the legacy replica, child run on new — relations resolve across the seam, no cross-DB join",
490490
async ({ prisma14, prisma17 }) => {

apps/webapp/test/apiRetrieveRunPresenter.readroute.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ async function seedAttempt(
227227
});
228228
}
229229

230-
// Seed a run plus a parent, a root, a child and one attempt — the tree the DoD
231-
// asserts round-trips. `seedTestRun.ts` only seeds a single root run, so the
232-
// tree + attempt rows are created inline here (per the plan's seeding note).
230+
// Seed a run plus a parent, a root, a child and one attempt — the tree that must
231+
// round-trip. `seedTestRun.ts` only seeds a single root run, so the tree + attempt
232+
// rows are created inline here.
233233
async function seedRunWithTree(
234234
prisma: PrismaClient,
235235
base: {

apps/webapp/test/apiRunListPresenter.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async function createRun(
188188
}
189189

190190
describe("ApiRunListPresenter public /runs list (PG14 legacy + PG17 new)", () => {
191-
// Step 1 + Step 6 (e2e #6): public list serves run-ops rows through the routed store. The
191+
// Public list serves run-ops rows through the routed store. The
192192
// forwarded readThroughDeps thread the dual-DB union into NextRunListPresenter; the public
193193
// payload (`{ data, pagination }`) must list the NEW ∪ legacy union, proving the public API
194194
// surfaces routed run-ops rows. The migrated/straggler rows (run_newA/run_newB) live on BOTH
@@ -281,7 +281,7 @@ describe("ApiRunListPresenter public /runs list (PG14 legacy + PG17 new)", () =>
281281
}
282282
);
283283

284-
// Step 2: genuinely-empty env returns { data: [], pagination } without error. Exercises the
284+
// Genuinely-empty env returns { data: [], pagination } without error. Exercises the
285285
// empty-state probe beneath NextRunListPresenter (no rows on either DB; empty CH page).
286286
replicationContainerTest(
287287
"genuinely-empty env returns { data: [], pagination } without error",
@@ -326,7 +326,7 @@ describe("ApiRunListPresenter public /runs list (PG14 legacy + PG17 new)", () =>
326326
}
327327
);
328328

329-
// Step 3 / DoD "env scoping unchanged": the control-plane runtimeEnvironment.findMany lookup
329+
// Env scoping unchanged: the control-plane runtimeEnvironment.findMany lookup
330330
// resolves the requested env via the `_replica` handle (NOT routed), with the 4th `environment`
331331
// arg omitted to force that branch. Result is scoped to the requested env only.
332332
replicationContainerTest(
@@ -370,7 +370,7 @@ describe("ApiRunListPresenter public /runs list (PG14 legacy + PG17 new)", () =>
370370
}
371371
);
372372

373-
// Step 4 / DoD "passthrough (single-DB)": two-arg-style construction (no readThroughDeps) ->
373+
// Passthrough (single-DB): two-arg-style construction (no readThroughDeps) ->
374374
// NextRunListPresenter receives undefined deps -> byte-identical single-DB path. The public
375375
// { data, pagination } shape is unchanged.
376376
replicationContainerTest(

apps/webapp/test/batchListPresenter.readroute.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function spyClient(
226226
const desc = (a: string, b: string) => (a < b ? 1 : a > b ? -1 : 0);
227227

228228
describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + PG17 new)", () => {
229-
// --- Task 3 Step 1: byte-identical scan + identical ORDER-BY across PG14/PG17 ---
229+
// Byte-identical scan + identical ORDER-BY across PG14/PG17.
230230
heteroPostgresTest(
231231
"raw paginated scan is byte-identical and identically ordered across PG14 and PG17 (both directions, with/without cursor)",
232232
async ({ prisma14, prisma17 }) => {
@@ -292,7 +292,7 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
292292
}
293293
);
294294

295-
// --- Task 3 Step 2: split scan merge serves new + legacy in one keyset-ordered page ---
295+
// Split scan merge serves new + legacy in one keyset-ordered page.
296296
heteroPostgresTest(
297297
"split scan merges new (PG17) + legacy (PG14) rows under the keyset order; legacy read only when new does not fill the page",
298298
async ({ prisma14, prisma17 }) => {
@@ -338,7 +338,7 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
338338
}
339339
);
340340

341-
// --- Task 3 Step 3: project resolves on control-plane; no cross-seam join ---
341+
// Project resolves on control-plane; no cross-seam join.
342342
heteroPostgresTest(
343343
"project resolves on the control-plane handle (PG14); BatchTaskRun scan reads run-ops only",
344344
async ({ prisma14, prisma17 }) => {
@@ -367,7 +367,7 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
367367
}
368368
);
369369

370-
// --- Task 3 Step 4: empty-state probe is dual-DB during the window ---
370+
// Empty-state probe is dual-DB during the window.
371371
heteroPostgresTest(
372372
"empty-state probe reads new then legacy replica: true when legacy has a batch, false when both empty",
373373
async ({ prisma14, prisma17 }) => {
@@ -396,7 +396,7 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
396396
}
397397
);
398398

399-
// --- Task 3 Step 5: single-DB passthrough collapses to one handle ---
399+
// Single-DB passthrough collapses to one handle.
400400
postgresTest(
401401
"passthrough (no readRoute): scan + probe + project all read the single handle; legacy closures never invoked",
402402
async ({ prisma }) => {
@@ -434,7 +434,6 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
434434
}
435435
);
436436

437-
// RED before fix: $queryRaw across clients → P2010/42601 "$1". GREEN after: typed findMany.
438437
heteroRunOpsPostgresTest(
439438
"scan against dedicated RunOpsPrismaClient (splitEnabled): returns batches from new DB",
440439
async ({ prisma14, prisma17 }) => {

apps/webapp/test/batchPresenter.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function makeEnvResolver(controlPlane: PrismaClient) {
137137
}
138138

139139
describe("BatchPresenter read-through (PG14 legacy + PG17 new)", () => {
140-
// DoD: batch detail resolves on run-ops NEW (split on). Legacy replica is never probed.
140+
// Batch detail resolves on run-ops NEW (split on). Legacy replica is never probed.
141141
heteroPostgresTest(
142142
"resolves a NEW-resident batch and never probes the legacy replica",
143143
async ({ prisma14, prisma17 }) => {
@@ -182,7 +182,7 @@ describe("BatchPresenter read-through (PG14 legacy + PG17 new)", () => {
182182
}
183183
);
184184

185-
// DoD: batch detail resolves on run-ops OLD/legacy READ REPLICA (split on, in-retention).
185+
// Batch detail resolves on run-ops OLD/legacy READ REPLICA (split on, in-retention).
186186
// Cross-version round-trip: PG14 legacy -> presenter, JSON error payload byte-identical.
187187
heteroPostgresTest(
188188
"resolves a legacy-only batch via the legacy READ REPLICA, byte-identical",
@@ -239,7 +239,7 @@ describe("BatchPresenter read-through (PG14 legacy + PG17 new)", () => {
239239
}
240240
);
241241

242-
// DoD: post-termination / not-found yields the normal "Batch not found".
242+
// Post-termination / not-found yields the normal "Batch not found".
243243
heteroPostgresTest(
244244
"throws the normal not-found when the batch is absent from both stores",
245245
async ({ prisma14, prisma17 }) => {
@@ -259,7 +259,7 @@ describe("BatchPresenter read-through (PG14 legacy + PG17 new)", () => {
259259
}
260260
);
261261

262-
// DoD: env decoupling parity for a DEVELOPMENT env (userName branch).
262+
// Env decoupling parity for a DEVELOPMENT env (userName branch).
263263
heteroPostgresTest(
264264
"resolves the DEVELOPMENT env userName separately from the run-ops batch row",
265265
async ({ prisma14, prisma17 }) => {
@@ -287,7 +287,7 @@ describe("BatchPresenter read-through (PG14 legacy + PG17 new)", () => {
287287
});
288288

289289
describe("BatchPresenter single-DB passthrough", () => {
290-
// DoD passthrough line + self-host collapse: one plain read, legacy closure never invoked.
290+
// Passthrough + self-host collapse: one plain read, legacy closure never invoked.
291291
containerTest(
292292
"single-DB resolves the batch with one plain read and never touches the legacy boundary",
293293
async ({ prisma }) => {

apps/webapp/test/nextRunListPresenter.readthrough.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ function throwingFindFirst(prisma: PrismaClient, label: string): PrismaClient {
172172
const callOptions = (ctx: SeedContext) => ({ projectId: ctx.projectId, pageSize: 10 });
173173

174174
describe("NextRunListPresenter dual-DB empty-state probe + routed hydrate (legacy + new Postgres)", () => {
175-
// --- no-false-empty. Runs ONLY on legacy, none on new. Empty CH page -> listRuns returns [].
175+
// no-false-empty. Runs ONLY on legacy, none on new. Empty CH page -> listRuns returns [].
176176
// splitEnabled true. The probe misses NEW, falls through to the legacy replica and finds the
177-
// row, so the dashboard must NOT show "no runs". ---
177+
// row, so the dashboard must NOT show "no runs".
178178
replicationContainerTest(
179179
"no-false-empty: runs only on the legacy replica still report hasAnyRuns true",
180180
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {
@@ -217,10 +217,10 @@ describe("NextRunListPresenter dual-DB empty-state probe + routed hydrate (legac
217217
}
218218
);
219219

220-
// --- new-DB short-circuit. A run on NEW, legacy replica wrapped so its taskRun.findFirst
220+
// new-DB short-circuit. A run on NEW, legacy replica wrapped so its taskRun.findFirst
221221
// throws. Empty CH page. The probe answers from NEW and must NEVER fall through to legacy. The
222222
// post-migration straggler is the same shape: present on NEW, absent from LEGACY, legacy never
223-
// invoked. ---
223+
// invoked.
224224
replicationContainerTest(
225225
"new-DB short-circuit: hasAnyRuns answered from the new DB without touching the legacy replica",
226226
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {
@@ -263,8 +263,8 @@ describe("NextRunListPresenter dual-DB empty-state probe + routed hydrate (legac
263263
}
264264
);
265265

266-
// --- genuinely empty. Nothing on either DB. Empty CH page. splitEnabled true. Both
267-
// probes run and return null -> the true empty state is preserved. ---
266+
// genuinely empty. Nothing on either DB. Empty CH page. splitEnabled true. Both
267+
// probes run and return null -> the true empty state is preserved.
268268
replicationContainerTest(
269269
"genuinely empty: both DBs empty reports hasAnyRuns false",
270270
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {
@@ -301,11 +301,11 @@ describe("NextRunListPresenter dual-DB empty-state probe + routed hydrate (legac
301301
}
302302
);
303303

304-
// --- passthrough single-DB (two-arg ctor). One `prisma`, seed a run, empty CH page.
304+
// passthrough single-DB (two-arg ctor). One `prisma`, seed a run, empty CH page.
305305
// splitEnabled defaults false -> exactly one plain findFirst against the single handle; the
306306
// split branch (new/legacy) is structurally never entered (no second handle is injected).
307307
// Also covers "served from the replica only" — the ctor exposes no legacy-writer field, so a
308-
// no-primary-read guarantee is structural. ---
308+
// no-primary-read guarantee is structural.
309309
replicationContainerTest(
310310
"passthrough single-DB: two-arg ctor finds the run via the single handle",
311311
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma }) => {
@@ -332,15 +332,15 @@ describe("NextRunListPresenter dual-DB empty-state probe + routed hydrate (legac
332332
}
333333
);
334334

335-
// --- list hydrate flows through the routed store: split, non-empty CH id-set whose rows are
335+
// list hydrate flows through the routed store: split, non-empty CH id-set whose rows are
336336
// split across NEW + the legacy replica. result.runs must be the union, id-desc ordered. This
337337
// proves the deps are threaded so the routed store is actually used.
338338
// We assert the rows that DO surface (the full union, since legacy is probed for any id that
339339
// misses on NEW).
340340
// The migrated runs (run_newA/run_newB) live on BOTH DBs with the same id + friendlyId but a
341341
// DISTINGUISHING taskIdentifier: "my-task" on legacy, "my-task-NEW" on new. #hydrateRunsByIds
342342
// takes NEW rows first and only probes legacy for ids NOT on NEW, so a migrated row can only
343-
// carry "my-task-NEW" if it was served from the threaded newClient (new DB) — asserted below. ---
343+
// carry "my-task-NEW" if it was served from the threaded newClient (new DB) — asserted below.
344344
replicationContainerTest(
345345
"list hydrate flows through the routed store: result.runs is the NEW + legacy union, id-desc",
346346
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {

apps/webapp/test/presenters/TestTaskPresenter.readthrough.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function throwingLegacyReplica(prisma: PrismaClient): PrismaClient {
202202
}
203203

204204
describe("TestTaskPresenter recent-payloads read-through (PG14 legacy + PG17 new)", () => {
205-
// --- DoD line + payloadType parity: split union of NEW + legacy-replica, JSON-only, createdAt desc ---
205+
// payloadType parity: split union of NEW + legacy-replica, JSON-only, createdAt desc.
206206
replicationContainerTest(
207207
"split mode hydrates the 10-most-recent CH id-set as the union of NEW + legacy-replica rows, payloadType filtered, createdAt desc",
208208
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {
@@ -312,7 +312,7 @@ describe("TestTaskPresenter recent-payloads read-through (PG14 legacy + PG17 new
312312
}
313313
);
314314

315-
// --- Old in-retention run served from the legacy READ REPLICA only (no legacyWriter field exists) ---
315+
// Old in-retention run served from the legacy READ REPLICA only (no legacyWriter field exists).
316316
replicationContainerTest(
317317
"an in-retention legacy-only run hydrates from the legacy replica handle",
318318
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {
@@ -369,7 +369,7 @@ describe("TestTaskPresenter recent-payloads read-through (PG14 legacy + PG17 new
369369
}
370370
);
371371

372-
// --- Passthrough (single-DB): one plain store read, the legacy replica never touched ---
372+
// Passthrough (single-DB): one plain store read, the legacy replica never touched.
373373
replicationContainerTest(
374374
"single-DB passthrough hydrates from one store read and never touches the legacy replica",
375375
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma }) => {
@@ -428,7 +428,7 @@ describe("TestTaskPresenter recent-payloads read-through (PG14 legacy + PG17 new
428428
}
429429
);
430430

431-
// --- SCHEDULED-source parity: same hydrate path, ScheduledRun mapping exercised ---
431+
// SCHEDULED-source parity: same hydrate path, ScheduledRun mapping exercised.
432432
replicationContainerTest(
433433
"SCHEDULED task: split union parses to ScheduledRun shape identically to single-DB",
434434
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {

apps/webapp/test/realtime/clickHouseRunListResolver.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function throwingTaskRunFindMany(prisma: PrismaClient): PrismaClient {
130130
}
131131

132132
describe("ClickHouseRunListResolver (realtime run-list id-set, split-neutral)", () => {
133-
// --- resolves the CH id-set with NO TaskRun PG hydrate ---
133+
// resolves the CH id-set with NO TaskRun PG hydrate.
134134
replicationContainerTest(
135135
"resolves the ClickHouse id-set for run-ops rows without ever reading TaskRun in Postgres",
136136
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma }) => {
@@ -168,7 +168,7 @@ describe("ClickHouseRunListResolver (realtime run-list id-set, split-neutral)",
168168
}
169169
);
170170

171-
// --- CH filter is split-neutral (ids independent of PG residency) ---
171+
// CH filter is split-neutral (ids independent of PG residency).
172172
replicationContainerTest(
173173
"returns the same id-set regardless of which Postgres the rows are hydrated from (CH-only path)",
174174
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma, network }) => {
@@ -223,7 +223,7 @@ describe("ClickHouseRunListResolver (realtime run-list id-set, split-neutral)",
223223
}
224224
);
225225

226-
// --- single-DB passthrough; no legacy/known-migrated probe on this path ---
226+
// single-DB passthrough; no legacy/known-migrated probe on this path.
227227
replicationContainerTest(
228228
"single-DB passthrough returns the CH id-set and never hydrates TaskRun",
229229
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma }) => {
@@ -255,7 +255,7 @@ describe("ClickHouseRunListResolver (realtime run-list id-set, split-neutral)",
255255
}
256256
);
257257

258-
// --- a far-future straggler's id surfaces from the CH id-set ---
258+
// a far-future straggler's id surfaces from the CH id-set.
259259
replicationContainerTest(
260260
"surfaces a far-future delayed run's id from the CH id-set",
261261
async ({ clickhouseContainer, redisOptions, postgresContainer, prisma }) => {
@@ -299,7 +299,7 @@ describe("ClickHouseRunListResolver (realtime run-list id-set, split-neutral)",
299299
}
300300
);
301301

302-
// --- tag match is contains-ALL (tagsMatch: "all" -> hasAll), authoritative ---
302+
// tag match is contains-ALL (tagsMatch: "all" -> hasAll), authoritative.
303303
// The sibling runReader.server.ts JSDoc still calls RunListFilter.tags "Contains-ANY"; that is
304304
// stale. The resolver passes tagsMatch: "all" and the live CH repo maps
305305
// it to hasAll, so contains-ALL is the real behavior — assert that, not the JSDoc.
@@ -345,7 +345,7 @@ describe("ClickHouseRunListResolver (realtime run-list id-set, split-neutral)",
345345
}
346346
);
347347

348-
// --- environment scoping: the CH filter excludes other environments ---
348+
// environment scoping: the CH filter excludes other environments.
349349
// Doubles as a structural proof that an accidental hydrate would NOT change the id-set: rows on a
350350
// different env are not returned because CH filters by environment_id, not because PG was read.
351351
replicationContainerTest(

0 commit comments

Comments
 (0)