Skip to content

Commit a3d309e

Browse files
tyulyukovclaude
andcommitted
test(projection): drop denormalized pending-approval-count assertions
Upstream c9b07d6 (pingdotgg#2004) added two ProjectionPipeline tests that assert on projection_threads.pending_approval_count after runtime projection. The prerequisite commit ce9f337 (pingdotgg#1973) teaches the pipeline to update that denormalized column alongside the projection_pending_approvals table, but MarCode's lazy-hydration design (see FEATURES.md) keeps the count computed via SQL aggregate at query time and leaves the column dormant (migration-time backfill only). Drop the threadRows queries + assertions from both upstream tests and leave a comment pointing to the architectural divergence. The approval row assertions (the actual stale/non-stale routing behavior) are preserved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 7bd7707 commit a3d309e

1 file changed

Lines changed: 9 additions & 16 deletions

File tree

apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,14 +1631,11 @@ it.layer(BaseTestLayer)("OrchestrationProjectionPipeline", (it) => {
16311631
},
16321632
]);
16331633

1634-
const threadRows = yield* sql<{
1635-
readonly pendingApprovalCount: number;
1636-
}>`
1637-
SELECT pending_approval_count AS "pendingApprovalCount"
1638-
FROM projection_threads
1639-
WHERE thread_id = 'thread-stale-approval'
1640-
`;
1641-
assert.deepEqual(threadRows, [{ pendingApprovalCount: 0 }]);
1634+
// MarCode's lazy-hydration design (see FEATURES.md) computes
1635+
// `pendingApprovalCount` on read via SQL aggregate; the
1636+
// `projection_threads.pending_approval_count` column stays dormant
1637+
// (updated only by migration-time backfill), so upstream's runtime
1638+
// assertion on the denormalized column is skipped here.
16421639
}),
16431640
);
16441641

@@ -1811,14 +1808,10 @@ it.layer(BaseTestLayer)("OrchestrationProjectionPipeline", (it) => {
18111808
},
18121809
]);
18131810

1814-
const threadRows = yield* sql<{
1815-
readonly pendingApprovalCount: number;
1816-
}>`
1817-
SELECT pending_approval_count AS "pendingApprovalCount"
1818-
FROM projection_threads
1819-
WHERE thread_id = 'thread-nonstale-approval'
1820-
`;
1821-
assert.deepEqual(threadRows, [{ pendingApprovalCount: 1 }]);
1811+
// See note on the "clears stale pending approvals" test above: MarCode
1812+
// reads `pendingApprovalCount` via SQL aggregate rather than
1813+
// maintaining the denormalized `projection_threads.pending_approval_count`
1814+
// column at runtime, so upstream's runtime assertion is skipped.
18221815
}),
18231816
);
18241817

0 commit comments

Comments
 (0)