{"record":{"id":"2983237968aa3071","repo":"nextlevelbuilder/ui-ux-pro-max-skill","slug":"verified-at-is-required-when-generating-the-summ","errorCode":null,"errorMessage":"--verified-at is required when generating the summary","messagePattern":"--verified-at is required when generating the summary","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/generate-catalog-summary.py","lineNumber":126,"sourceCode":"        text = (ROOT / name).read_text(encoding=\"utf-8\")\n        missing = [token for token in tokens if token not in text]\n        if missing:\n            raise ValueError(f\"{name} catalog counts are stale: {', '.join(missing)}\")\n\n\ndef main():\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument(\"--verified-at\")\n    parser.add_argument(\"--check\", action=\"store_true\")\n    args = parser.parse_args()\n    try:\n        verified_at = args.verified_at\n        if args.check and not verified_at:\n            if not OUTPUT.exists():\n                raise ValueError(\"catalog-summary.json is missing\")\n            verified_at = json.loads(OUTPUT.read_text(encoding=\"utf-8\")).get(\"verifiedAt\")\n        if not verified_at:\n            raise ValueError(\"--verified-at is required when generating the summary\")\n        summary = build(verified_at)\n        content = json.dumps(summary, ensure_ascii=False, indent=2) + \"\\n\"\n        if args.check:\n            if not OUTPUT.exists() or OUTPUT.read_text(encoding=\"utf-8\") != content:\n                raise ValueError(\"catalog-summary.json is stale; regenerate it\")\n            check_readme_counts(summary)\n        else:\n            OUTPUT.write_text(content, encoding=\"utf-8\")\n    except (KeyError, OSError, ValueError, json.JSONDecodeError) as exc:\n        print(f\"generate-catalog-summary: {exc}\", file=sys.stderr)\n        return 2\n    print(\"Catalog summary is current.\" if args.check else \"Generated catalog summary.\")\n    return 0\n\n\nif __name__ == \"__main__\":\n    raise SystemExit(main())\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/blob/a38d04c3d5c298c851dbe5e6ee1965ee3de42cb5/scripts/generate-catalog-summary.py#L108-L144","documentation":"Raised by generate-catalog-summary.py when no --verified-at value is available. The script builds catalog-summary.json from a verification timestamp; without --check it has no fallback source, so an explicit --verified-at is mandatory for generation mode. It surfaces as a stderr message and exit code 2 via the except clause catching ValueError.","triggerScenarios":"Running `python3 scripts/generate-catalog-summary.py` with no arguments (generation mode) — args.verified_at is None and args.check is False, so the `if not verified_at` branch fires. Also `--check` without --verified-at when catalog-summary.json exists but its JSON has no 'verifiedAt' key (json.loads(...).get('verifiedAt') returns None).","commonSituations":"A maintainer regenerates the summary after editing CSV data but forgets the timestamp flag; or the committed catalog-summary.json was hand-edited/truncated so 'verifiedAt' is missing, and CI runs `--check` without the flag.","solutions":["Pass the timestamp explicitly: `python3 scripts/generate-catalog-summary.py --verified-at 2026-08-14` (use the date the catalog data was actually verified).","If you meant only to verify freshness, run with `--check` after ensuring the existing catalog-summary.json contains a 'verifiedAt' key.","If catalog-summary.json is missing entirely during `--check`, generate it first with --verified-at, then commit it."],"exampleFix":"# before\npython3 scripts/generate-catalog-summary.py\n# generate-catalog-summary: --verified-at is required when generating the summary\n\n# after\npython3 scripts/generate-catalog-summary.py --verified-at 2026-08-14","handlingStrategy":"validation","validationCode":"# Pre-flight in a shell/CI step before generating:\nimport json, pathlib, sys\nout = pathlib.Path(\"catalog-summary.json\")\nif not out.exists():\n    verified = None\nelse:\n    try:\n        verified = json.loads(out.read_text(encoding=\"utf-8\")).get(\"verifiedAt\")\n    except json.JSONDecodeError:\n        verified = None\nif not verified and \"--verified-at\" not in sys.argv:\n    sys.exit(\"refusing to run: no --verified-at and no stored verifiedAt\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap the call in CI and always pass --verified-at explicitly on generation runs.","Treat catalog-summary.json as generated output: never hand-edit, so its verifiedAt key stays trustworthy.","Document the exact generation command (with the flag) next to the data files it summarizes."],"tags":["cli","argparse","catalog","validation"],"backgroundTag":null,"analyzedSha":"a38d04c3d5c298c851dbe5e6ee1965ee3de42cb5","analyzedAt":"2026-08-14T18:51:02.321Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}