a2aproject / a2aproject/a2a-tck
bug(tck): CARD-CACHE-003 is MAY-level but test hard-fails when header is absent
- Lenguaje dominante
- Python
- Estrellas
- 50
- Forks
- 40
- Merge medio
- 7 d 1 h
- PR fusionados (30 d)
- 1
Descripción
## 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.
Guía de contribución
Línea de trabajo
The issue is in the test file `tck/requirements/agent_card.py` around line 218. Look at the `test_last_modified_present` method and the `@may` decorator. Understand how the test currently asserts the header's presence. Check how other `@may` tests are handled. The fix likely involves modifying the assertion logic to skip or not fail when the header is absent, and ensuring the reporting reflects a MAY-level requirement correctly.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- testing
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Activo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 75/100