@@ -278,6 +278,16 @@ def parse_milestone(value: str) -> tuple[int, int, int]:
278278 return (major , minor , patch )
279279
280280
281+ def _normalize_validity_attr (value : object | None ) -> str | None :
282+ """Normalize validity attributes and treat whitespace-only values as missing."""
283+ if value is None :
284+ return None
285+ if isinstance (value , str ):
286+ normalized = value .strip ()
287+ return normalized if normalized else None
288+ return str (value )
289+
290+
281291# req-Id: tool_req__docs_req_attr_validity_consistency
282292@local_check
283293def check_validity_consistency (
@@ -286,17 +296,24 @@ def check_validity_consistency(
286296 log : CheckLogger ,
287297):
288298 """
289- Check if the attributes valid_from < valid_until.
299+ Check if the attributes valid_from and valid_until are set and valid_from < valid_until.
290300 """
291301 if need ["type" ] not in ("stkh_req" , "feat_req" ):
292302 return
293303
294- valid_from = need .get ("valid_from" , None )
295- valid_until = need .get ("valid_until" , None )
304+ valid_from = _normalize_validity_attr (need .get ("valid_from" , None ))
305+ valid_until = _normalize_validity_attr (need .get ("valid_until" , None ))
306+
307+ # Temporary grace period: only enforce presence of valid_from as non-fatal info.
308+ if not valid_from :
309+ msg = "missing validity attribute: valid_from must be set."
310+ log .warning_for_need (need , msg , is_new_check = True )
311+ return
296312
297- if not valid_from or not valid_until :
313+ if not valid_until :
298314 return
299315
316+ # Both attributes are present, check consistency
300317 valid_from_version = parse_milestone (valid_from )
301318 valid_until_version = parse_milestone (valid_until )
302319 if valid_from_version >= valid_until_version :
0 commit comments