nextlevelbuilder/ui-ux-pro-max-skill · error · ValueError

--verified-at is required when generating the summary

Error message

--verified-at is required when generating the summary

What it means

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.

Source

Thrown at scripts/generate-catalog-summary.py:126

        text = (ROOT / name).read_text(encoding="utf-8")
        missing = [token for token in tokens if token not in text]
        if missing:
            raise ValueError(f"{name} catalog counts are stale: {', '.join(missing)}")


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--verified-at")
    parser.add_argument("--check", action="store_true")
    args = parser.parse_args()
    try:
        verified_at = args.verified_at
        if args.check and not verified_at:
            if not OUTPUT.exists():
                raise ValueError("catalog-summary.json is missing")
            verified_at = json.loads(OUTPUT.read_text(encoding="utf-8")).get("verifiedAt")
        if not verified_at:
            raise ValueError("--verified-at is required when generating the summary")
        summary = build(verified_at)
        content = json.dumps(summary, ensure_ascii=False, indent=2) + "\n"
        if args.check:
            if not OUTPUT.exists() or OUTPUT.read_text(encoding="utf-8") != content:
                raise ValueError("catalog-summary.json is stale; regenerate it")
            check_readme_counts(summary)
        else:
            OUTPUT.write_text(content, encoding="utf-8")
    except (KeyError, OSError, ValueError, json.JSONDecodeError) as exc:
        print(f"generate-catalog-summary: {exc}", file=sys.stderr)
        return 2
    print("Catalog summary is current." if args.check else "Generated catalog summary.")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

View on GitHub (pinned to a38d04c3d5)

Solutions

  1. Pass the timestamp explicitly: `python3 scripts/generate-catalog-summary.py --verified-at 2026-08-14` (use the date the catalog data was actually verified).
  2. If you meant only to verify freshness, run with `--check` after ensuring the existing catalog-summary.json contains a 'verifiedAt' key.
  3. If catalog-summary.json is missing entirely during `--check`, generate it first with --verified-at, then commit it.

Example fix

# before
python3 scripts/generate-catalog-summary.py
# generate-catalog-summary: --verified-at is required when generating the summary

# after
python3 scripts/generate-catalog-summary.py --verified-at 2026-08-14
Defensive patterns

Strategy: validation

Validate before calling

# Pre-flight in a shell/CI step before generating:
import json, pathlib, sys
out = pathlib.Path("catalog-summary.json")
if not out.exists():
    verified = None
else:
    try:
        verified = json.loads(out.read_text(encoding="utf-8")).get("verifiedAt")
    except json.JSONDecodeError:
        verified = None
if not verified and "--verified-at" not in sys.argv:
    sys.exit("refusing to run: no --verified-at and no stored verifiedAt")

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of nextlevelbuilder/ui-ux-pro-max-skill@a38d04c3d5 (2026-08-14). Data as JSON: /api/errors/2983237968aa3071. Report an issue: GitHub.