Carry the consent CI acceptance repair into attempt preparation

Preserve the verified attempt patch while inheriting the parent retention test fix. This local branch remains unpublished until consent lands.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-28 10:09:00 -05:00
commit 642095e2cb
2 files changed
+51 -5

No files matched your search

@@ -181,3 +181,39 @@ and the explicitly accepted company-deletion ownership policy. The report parent
has a documentation-only follow-up after `c28de398` and still needs its own latest
CI/reviews. This local Teams preparation must preserve that actual landed parent
before publication; it is not authority to merge into an unmerged feature branch.
## Inherited retention CI fairness repair — October 28
Current Teams head `36f43922` received exact-head Greptile 5/5 and Ponytail 5/5,
but CI run `40708566195`, server shard 6/12 job `122887395220`, failed the existing
voice-retention case `pages through more than one batch of history across
companies`. The shard had 2,291 passed tests, one failed and one skipped. Its
initial assertion expected the other company's row already deleted after one
startup batch, even when its random ID put it beyond the first 100-row inventory
page. This CI failure is not accepted as green evidence.
Placing the other company at a fixed final UUID reproduces the exact assertion.
The fixture now uses a supplied ID for both insertion and its transaction hint.
The test controls scheduler time, requires that row to remain before discovery,
then requires its deletion in the next fair batch after page-two discovery. It
also checks the first 25 deletions leave exactly 80 eligible rows, drains all
remaining history, and verifies SQL quiet. The existing five-second assertion
wait budget and global test timeout are unchanged. This corrects the acceptance
expectation without changing retention, Teams, or shared scheduler behavior.
The complete 13-case retention suite passes. Its run spent 96.66 seconds in
module transforms but all actual cases completed successfully; no timeout was
increased and this was not counted as a failed test or silently retried. A
guarded mutation bypassing company rotation fails the new post-discovery fair
batch assertion. The original shared helper was restored byte-for-byte. The
previous 223-case Teams acceptance remains evidence for unchanged Teams source;
these 13 retention cases are a separate CI-repair acceptance group. Earlier
current-head Greptile/Ponytail scores become stale after publishing this test-only
follow-up, and fresh CI must pass independently. No old-job retry or waiver is
claimed.
Logs: `/tmp/sleep26-36f-server6-job.log`,
`/tmp/sleep26-retention-fairness-red.log`,
`/tmp/sleep26-retention-fairness-green.log`, and
`/tmp/sleep26-retention-fairness-mutant-red.log`.
@@ -56,7 +56,7 @@ const support = external ? { supported: true } : await getEmbeddedPostgresTestSu
});
afterAll(async () => { await db?.$client.end({ timeout: 1 }); await temporary?.cleanup(); });
async function admission(patch: Partial<typeof chatVoiceInboundCalls.$inferInsert> = {}, writer = db) {
const id = randomUUID();
const id = patch.id ?? randomUUID();
return writer.transaction(async tx => {
await notifyVoiceInbound(tx, { kind: "admission", id });
return (await tx.insert(chatVoiceInboundCalls).values({ id, companyId, endpointId, providerSessionId: randomUUID(), state: "ended", cleanupConfirmedAt: new Date(), updatedAt: new Date(Date.now() - week - 1000), approvalCode: "123456", generation: 1, credentialFingerprint: "test", toolTokenHash: "a".repeat(64), requestFingerprint: id, expiresAt: new Date(Date.now() - week - 1000), ...patch }).returning())[0];
@@ -211,12 +211,22 @@ const support = external ? { supported: true } : await getEmbeddedPostgresTestSu
expect(coordinator!.nextWakeAt()).toBeNull(); await quiet();
});
it("pages through more than one batch of history across companies", async () => {
vi.useFakeTimers({ toFake: ["Date", "setTimeout", "clearTimeout"], shouldAdvanceTime: false });
for (let i = 0; i < 104; i++) await admission();
const other = await fixture(); const last = await admission({ companyId: other.companyId, endpointId: other.endpointId });
const other = await fixture(); const last = await admission({ id: "ffffffff-ffff-4fff-bfff-ffffffffffff", companyId: other.companyId, endpointId: other.endpointId });
const service = await start();
expect(await row(last.id)).toBeUndefined();
await vi.waitFor(async () => { await vi.advanceTimersByTimeAsync(1000); expect(await service.load()).toHaveLength(0); }, { timeout: 5000 });
await flush(); await quiet();
expect(await row(last.id)).toBeDefined();
expect(await service.load()).toHaveLength(80);
await vi.advanceTimersByTimeAsync(1000);
await vi.waitFor(async () => expect(await row(last.id)).toBeUndefined(), { interval: 0, timeout: 5000 });
for (let pass = 0; pass < 20; pass++) {
await vi.advanceTimersByTimeAsync(1000);
await vi.waitFor(() => expect(coordinator!.nextWakeAt() !== null || idleWorkSnapshot().active === 0).toBe(true), { interval: 0, timeout: 5000 });
}
await flush();
expect(await service.load()).toHaveLength(0);
expect(await db.select().from(chatVoiceInboundCalls).where(eq(chatVoiceInboundCalls.companyId, companyId))).toHaveLength(0);
expect(await row(last.id)).toBeUndefined(); await quiet();
});
it("retains failed deletion for a bounded retry and then becomes quiet", async () => {
const call = await admission();