arrow_backRetour aux issues
Tracer-Cloud/opensre
#5196
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Tests: honour turn-seam contracts in test_upgrade_cta_accept.py
ecoDébutant
good first issue
descriptionDescription
## Goal
Make the turn-stage fakes in `tests/core/agent_harness/session/test_upgrade_cta_accept.py` honour the contracts they replace.
Two patterns to remove, both of which keep a test green when the contract
changes underneath it:
- a stage injected as `lambda *_a, **_k` — ignores the callable Protocol
- an answer faked as `type("Run", (), {...})()` — an anonymous object with
one attribute, standing in for a real result type
## Swallow-all seam stubs in this file (2)
```
37: gather=lambda *_a, **_k: "should-not-run",
38: answer=lambda *_a, **_k: type("Run", (), {"response_text": "Draft outline."})(),
```
Each of these should take the signature its Protocol declares.
`EvidenceGatherer`, for example, is
`__call__(self, text: str, *, turn_plan: Any = None)`
(`core/agent_harness/ports.py`), so its stub is:
```python
def no_evidence(text: str, *, turn_plan: Any = None) -> GatheredEvidence | None:
"""An EvidenceGatherer that finds nothing."""
return None
```
Add a required keyword to the Protocol and that version fails at once;
the swallow-all lambda keeps passing.
## Anonymous result objects in this file (1)
```
38: answer=lambda *_a, **_k: type("Run", (), {"response_text": "Draft outline."})(),
```
Expected: a real `LlmRunInfo` from the shared helper, so the test fails
when the type gains a field the product reads.
```python
return fake_llm_run(response_text="...")
```
## Order
Depends on #5187 (shared turn-seam helpers). Wait for it to land.
## Acceptance
- [ ] No `lambda *_a, **_k` passed as a stage in `tests/core/agent_harness/session/test_upgrade_cta_accept.py`
- [ ] No `type("Run", ...)` result fakes in `tests/core/agent_harness/session/test_upgrade_cta_accept.py`
- [ ] Stubs are named functions reusing the shared helpers
- [ ] Test intent unchanged: `answer=None` means the real stage runs, a
no-op stub means no answer — do not swap one for the other
- [ ] `uv run pytest tests/core/agent_harness/session/test_upgrade_cta_accept.py` green, no product change
## Out of scope
Other files, monkeypatch lambdas that are not stage injections, and
product Protocol bodies.
## Guidelines
`AGENTS.md` — Protocols as callable contracts; test fakes are named `def`s.
Issues similaires
calkit/calkit
star53
Poids du dépôt moyen
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an implicit map…
Python
bug
good first issue
fu351/Doberman-Core
star211
Poids du dépôt léger
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:546`) every …
Python
enhancement
good first issue
fu351/Doberman-Core
star211
Poids du dépôt léger
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the risk badge,…
Python
enhancement
good first issue