{"record":{"id":"b84f2ccf558c1a43","repo":"Graphify-Labs/graphify","slug":"error-unknown-platform-key","errorCode":null,"errorMessage":"error: unknown platform '{key}'","messagePattern":"error: unknown platform '(.+?)'","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"tools/skillgen/gen.py","lineNumber":1313,"sourceCode":"    # The git-show validators read origin/v8. On a shallow checkout that ref is\n    # absent; skip with a clear, actionable message instead of crashing. CI fixes\n    # this for real by setting fetch-depth: 0 so the validators actually run.\n    _GIT_SHOW_VALIDATORS = (args.audit_coverage, args.monolith_roundtrip, args.always_on_roundtrip)\n    if any(_GIT_SHOW_VALIDATORS) and not _v8_available():\n        print(\n            \"SKIPPED: origin/v8 is not fetchable in this checkout, so the git-show \"\n            \"validators cannot run. On CI, set fetch-depth: 0 on this job (actions/\"\n            \"checkout) so origin/v8 is fetched and the validators run for real.\",\n            file=sys.stderr,\n        )\n        return 0\n\n    if args.audit_coverage:\n        keys = [args.platform] if args.platform else sorted(platforms)\n        all_problems: list[str] = []\n        for key in keys:\n            if key not in platforms:\n                raise SystemExit(f\"error: unknown platform '{key}'\")\n            all_problems.extend(f\"[{key}] {m}\" for m in audit_coverage(platforms[key]))\n        if all_problems:\n            print(\"audit-coverage FAILED:\", file=sys.stderr)\n            for m in all_problems:\n                print(f\"  {m}\", file=sys.stderr)\n            return 1\n        print(\"audit-coverage OK: every per-host v8 heading single-homes in that host's render.\")\n        return 0\n\n    if args.schema_singleton:\n        problems = schema_singleton(\n            {args.platform: platforms[args.platform]} if args.platform else platforms\n        )\n        if problems:\n            print(\"schema-singleton FAILED (file_type enum drift):\", file=sys.stderr)\n            for m in problems:\n                print(f\"  {m}\", file=sys.stderr)\n            return 1","sourceCodeStart":1295,"sourceCodeEnd":1331,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/tools/skillgen/gen.py#L1295-L1331","documentation":"In the audit-coverage branch of skillgen's CLI main(), each key derived from --platform (or the full sorted platform list) is checked against the platforms registry before audit_coverage() runs. An unrecognized key exits immediately with SystemExit('error: unknown platform …'). Unlike the render_all() variant (which lists known platforms), this shorter message is purely a usage guard on the audit path.","triggerScenarios":"Running `gen.py --audit-coverage --platform <key>` (or the equivalent subcommand) with a key not present in the platforms dict — typo, wrong case, or a removed/renamed platform definition.","commonSituations":"Copy-pasting a --platform value from old docs after a platform rename; case mismatches ('Codex' vs 'codex'); running the audit on a checkout whose platform registry differs from the one the docs were written for.","solutions":["Use an exact, case-sensitive key from the platforms registry (inspect sorted(platforms) in tools/skillgen/gen.py)","Omit --platform to audit all platforms instead of guessing a single key","If the platform should exist, restore/add its definition in the platforms registry and re-run"],"exampleFix":"# before\n$ python tools/skillgen/gen.py --audit-coverage --platform Codex   # error: unknown platform 'Codex'\n\n# after\n$ python tools/skillgen/gen.py --audit-coverage --platform codex","handlingStrategy":"validation","validationCode":"from tools.skillgen.gen import platforms\n\nkey = 'codex'\nassert key in platforms, f'unknown platform {key!r}; valid: {sorted(platforms)}'\nproblems = audit_coverage(platforms[key])","typeGuard":"def is_known_platform(key: str, platforms: dict) -> bool:\n    return isinstance(key, str) and key in platforms","tryCatchPattern":null,"preventionTips":["Derive --platform values from the registry (sorted(platforms)) in scripts and CI configs","Case-check: platform keys are lowercase; reject capitalized input early","When a platform is renamed, grep CI scripts and docs for the old key in the same commit"],"tags":["cli","validation","code-generation","audit","python"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}