{"record":{"id":"f4e47d421cfbec21","repo":"nextlevelbuilder/ui-ux-pro-max-skill","slug":"verified-at-must-use-yyyy-mm-dd","errorCode":null,"errorMessage":"verified-at must use YYYY-MM-DD","messagePattern":"verified-at must use YYYY-MM-DD","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"scripts/generate-catalog-summary.py","lineNumber":34,"sourceCode":"\ndef rows(name):\n    with (DATA / name).open(encoding=\"utf-8\", newline=\"\") as handle:\n        return list(csv.DictReader(handle))\n\n\ndef digest(path):\n    return hashlib.sha256(path.read_bytes()).hexdigest()\n\n\ndef load_json(name):\n    return json.loads((DATA / name).read_text(encoding=\"utf-8\"))\n\n\ndef checked_date(value):\n    try:\n        parsed = date.fromisoformat(value)\n    except (TypeError, ValueError) as exc:\n        raise ValueError(\"verified-at must use YYYY-MM-DD\") from exc\n    if parsed.year <= 1970 or parsed > date.today():\n        raise ValueError(f\"verified-at has suspicious date {value!r}\")\n    return value\n\n\ndef build(verified_at):\n    styles = rows(\"styles.csv\")\n    stack_paths = sorted((DATA / \"stacks\").glob(\"*.csv\"))\n    licenses = load_json(\"google-font-licenses.json\")\n    icons = load_json(\"phosphor-icons-upstream.json\")\n    excluded = licenses.get(\"excludedFamilies\", [])\n    counts = {\n        \"styles\": {\n            \"total\": len(styles),\n            \"searchable\": sum(row.get(\"Status\") != \"deprecated\" for row in styles),\n            \"active\": sum(row.get(\"Status\") == \"active\" for row in styles),\n            \"supplemental\": sum(row.get(\"Status\") == \"supplemental\" for row in styles),\n            \"deprecated\": sum(row.get(\"Status\") == \"deprecated\" for row in styles),","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/blob/a38d04c3d5c298c851dbe5e6ee1965ee3de42cb5/scripts/generate-catalog-summary.py#L16-L52","documentation":"generate-catalog-summary.py validates its --verified-at argument with date.fromisoformat(); anything that isn't a strict ISO YYYY-MM-DD date raises ValueError('verified-at must use YYYY-MM-DD'). It exists because the date is embedded into catalog-summary.json as the verification stamp and must stay machine-parseable.","triggerScenarios":"Passing --verified-at 2026-8-14 (no zero padding), '14-08-2026', '2026/08/14', a datetime like '2026-08-14T00:00:00', or no value at all when generation requires it (None hits the TypeError branch).","commonSituations":"Shell scripts building the date with unpadded strftime tokens (`date +%-Y-%-m-%-d`); CI passing a git timestamp with a time component; humans typing natural-language dates.","solutions":["Use the zero-padded ISO form: --verified-at 2026-08-14.","In scripts, use `date +%F` (equivalent to `date +%Y-%m-%d`) which emits ISO format.","When running --check with no argument, remember the date is read from the existing catalog-summary.json instead — only generation requires the flag."],"exampleFix":"# before\npython3 scripts/generate-catalog-summary.py --verified-at 2026-8-14\n# after\npython3 scripts/generate-catalog-summary.py --verified-at $(date +%F)","handlingStrategy":"validation","validationCode":"from datetime import date\n\ndef is_iso_date(s):\n    try:\n        date.fromisoformat(s)\n        return True\n    except (TypeError, ValueError):\n        return False\n\nassert is_iso_date(args.verified_at), 'pass --verified-at as YYYY-MM-DD (e.g. $(date +%F))'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass $(date +%F) from scripts instead of assembling dates manually.","Never use unpadded %-m/%-d strftime tokens for this flag.","Add a CI lint for the flag format."],"tags":["python","date-validation","developer-tooling"],"backgroundTag":null,"analyzedSha":"a38d04c3d5c298c851dbe5e6ee1965ee3de42cb5","analyzedAt":"2026-08-14T18:51:02.321Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}