# E2e Regression Async Generators

> End-to-end regression tests for async generator copy logic

- Skill: `zaxbyhub/e2e-regression-async-generators` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zaxbyhub/e2e-regression-async-generators`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zaxbyhub/e2e-regression-async-generators/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zaxbyhub (https://skillmd.com/u/zaxbyhub)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zaxbyhub/e2e-regression-async-generators

---


<!-- generated by opencode-swarm skill-generator. Do not edit by hand; edits will be preserved on regeneration only with controlled update mode. -->

# End-to-end regression tests for async generator copy logic

## Trigger

When a code change touches copy logic inside an async generator path, prefer
end-to-end tests that consume the full generator and assert specific values,
not unit tests of private methods that hand-simulate the copy.

## Triggers

- async generator
- copy logic
- done chunk
- RAGEngine.query
- regression test
- integration bug
- unit test gap

## Required Procedure

- Drive the real production async generator path end-to-end (e.g., `engine.query(...)`).
- Consume the full async generator output; do not short-circuit after the first yield.
- Assert specific values on the emitted payload, not just key presence.
- For copy logic, verify the copied value matches the source value resolved by the production path.
- Ensure the regression test fails when the production copy logic is removed or broken.

## Example

Canonical pattern: `backend/tests/test_prompt_ab_variants.py::TestDoneMsgABKeysE2E`

## Forbidden Shortcuts

- Do not hand-simulate the copy step in a test of a private helper and assert the same assignment.
- Do not assert only key presence when value correctness is the actual contract.
- Do not stop consuming the generator early unless the test explicitly targets an early-stage behavior.

## Delegation Template

When delegating a task affected by this skill, include:

```
SKILLS: file:.opencode/skills/generated/e2e-regression-async-generators/SKILL.md
```

## Reviewer Checks

- Verify each required action above appears in the diff.

## Source Knowledge IDs

- 2274327e-4f6f-4a2f-b3eb-f1c915b14af2 — End-to-end tests that consume the full async generator catch integration bugs that unit tests of private methods miss.
- 584bad6d-c7ee-4486-8ad4-3c4ef319e5ff — Copy logic inside async generator paths must be verified end-to-end, not by unit-testing a private helper in isolation.

