Repository navigation
test+ci(chatcore): semanticCache HIT fixture (15/15 mutate) + 350min budget headroom for auth/accountFallback batches - #4225
Conversation
…tate (15/15 leaves) The last chatCore leaf, semanticCache.ts, was excluded from Stryker `mutate` because its cache-HIT block (the bulk of the logic) had no covering test — only the guard-false / cache-MISS paths were exercised, so its mutants would survive. chatcore-semantic-cache now seeds the real cache via setCachedResponse (the in-memory store getCachedResponse checks first — no mock.module, which is unavailable under the Stryker tap-runner) under the exact signature checkSemanticCache rebuilds. Three HIT tests then run the HIT branch end-to-end: non-streaming JSON, streaming SSE (text/event-stream + [DONE]), and a no-usage body (cost falls back to 0). They assert the cache headers, the response body per stream/content-type branch, and the persistAttemptLogs / logConvertedResponse / log.debug side effects — killing the HIT-block mutants. Wired: semanticCache.ts -> stryker.conf.json `mutate` + nightly batch i, and chatcore-semantic-cache.test.ts -> tap.testFiles. ALL 15/15 chatCore leaves are now mutated. Config/test-only; mutation testing stays advisory (nightly). QG v2 Fase 9 T5 Fase 3 follow-up.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Adendo: budget headroom para os 2 batches grandes (a/b)Diagnóstico das runs do
Um cold run que nunca completa nunca escreve Fix (commit Run de validação forçada agora ( |
…) + extend to c/d/g/h (#4258) Restore cold-seed timeout headroom in nightly-mutation (per-batch timeout: a/b/c/d=350, g/h=240, rest=180). A cold Stryker run must complete once to seed stryker-incremental.json; a job cancelled at the cap never seeds. Integrated into release/v3.8.29.
…tate (15/15 leaves) (cheaper-inference#4225) Integrated into release/v3.8.29 (semanticCache HIT-path fixture + stryker 15/15 chatCore leaves).
…rence#4225 squash) + extend to c/d/g/h (cheaper-inference#4258) Restore cold-seed timeout headroom in nightly-mutation (per-batch timeout: a/b/c/d=350, g/h=240, rest=180). A cold Stryker run must complete once to seed stryker-incremental.json; a job cancelled at the cap never seeds. Integrated into release/v3.8.29.
O quê
Fecha o último chatCore leaf que faltava no Stryker
mutate:semanticCache.ts. Com isso, 15/15 leaves dochatCore/passam a ser mutados na noturna.Por quê estava de fora
O
semanticCache.tsfoi excluído domutateno #4222 porque o bloco de cache-HIT (o grosso da lógica) não tinha teste — só os caminhos guard-false / cache-MISS eram exercitados, então a maioria dos mutantes do HIT sobreviveria (sem clean kill).Como o fixture funciona (sem mock.module)
mock.modulenão está disponível sob o tap-runner do Stryker. O teste então semeia o cache real viasetCachedResponse(o store em-memória quegetCachedResponsecheca primeiro) sob a assinatura exata quecheckSemanticCachereconstrói (generateSignaturecom os mesmosmodel/messages/temperature/top_p/apiKeyId). Isso dispara o branch de HIT ponta-a-ponta.3 testes de HIT novos:
application/json, body = JSON do cached, headersX-OmniRoute-Cache: HIT+Cache-Hit: true, e os side-effects (persistAttemptLogscomstatus:200/cacheSource:"semantic",logConvertedResponse(cached),log.debug).stream:true) →text/event-stream, body SSE com framesdata:+ terminador[DONE].cachedUsageresolveundefined→cachedCost = 0→ headerresponseCostno sentinel zero.Matam os mutantes do bloco HIT (status /
"semantic"/"HIT"/ os ternários stream+content-type / o fallback de custo / as chamadas de side-effect).Mudanças
tests/unit/chatcore-semantic-cache.test.ts— +3 testes de HIT (os 5 guard/miss originais permanecem). 8/8 verde local.stryker.conf.json—semanticCache.ts→mutate(30→31),chatcore-semantic-cache.test.ts→tap.testFiles(137→138), comentário_mutate_godfiles_excluded_commentatualizado (15/15)..github/workflows/nightly-mutation.yml—semanticCache.ts→ batch i (3 arquivos); comentário do header atualizado.Notas
continue-on-error).BATCH_MUTATEenv →--mutate "$BATCH_MUTATE").mutatedo conf (verificado).QG v2 Fase 9 T5 — Fase 3 follow-up. Encerra a re-habilitação do mutation testing pela via unit-testável:
mutate6→31, 9 batches, 15/15 chatCore leaves + todos os combo leaves.🤖 Generated with Claude Code