| name | e2e-regression-async-generators |
| description | End-to-end regression tests for async generator copy logic |
| triggers | ["async generator","copy logic","done chunk","RAGEngine.query","regression test","integration bug","unit test gap"] |
| generated_from_knowledge | ["2274327e-4f6f-4a2f-b3eb-f1c915b14af2"] |
| source_knowledge_ids | ["2274327e-4f6f-4a2f-b3eb-f1c915b14af2","584bad6d-c7ee-4486-8ad4-3c4ef319e5ff"] |
| generated_at | "2026-07-06T17:07:25.088Z" |
| confidence | 0.7 |
| status | active |
| version | 2 |
| skill_origin | generated |
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.