a2aproject / a2aproject/a2a-tck
bug(tck): CARD-CACHE-003 is MAY-level but test hard-fails when header is absent
- Langage dominant
- Python
- Étoiles
- 50
- Forks
- 40
- Merge moyen
- 7 j 1 h
- PR mergées (30 j)
- 1
Description
## Problem
`CARD-CACHE-003` (Last-Modified header) is registered as `RequirementLevel.MAY` in [`tck/requirements/agent_card.py:218`](https://github.com/a2aproject/a2a-tck/blob/main/tck/requirements/agent_card.py#L218) and decorated `@may` in the test class, but `test_last_modified_present` hard-`assert`s on the header's presence:
```python
last_modified = response.headers.get("last-modified")
valid = last_modified is not None
# ...
assert valid, _fail_msg(req, errors[0])
```
Per RFC 2119, MAY means the item is truly optional. A conformant implementation that omits the header is exercising a legitimate choice — the TCK shouldn't count that as a failure.
## Impact
- The compatibility report shows `CARD-CACHE-003` as `FAIL` for any SUT that doesn't emit `Last-Modified`, even though it's not required.
- A reference SUT that ships the header to silence the test masks this classification bug rather than surfacing it.
## Expected behavior
A `MAY`-level requirement that the SUT doesn't satisfy should be reported as `NOT TESTED` or `SKIPPED`, not `FAIL`. The `@may` marker should prevent a hard assertion failure — either:
1. The test should use `pytest.skip()` or `pytest.xfail()` when the header is absent, or
2. The reporting layer should downgrade MAY-level assertion failures to a non-FAIL status.
## Related
Discovered while working on #234 / #235. The SUT PR intentionally does **not** emit `Last-Modified` to avoid masking this.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.