{"record":{"id":"0ba796f723faee74","repo":"remoteintech/remote-jobs","slug":"invalid-remote-policy-data-remote-policy","errorCode":null,"errorMessage":"Invalid `remote_policy`: \"${data.remote_policy}\". Must be one of: ${VALID_REMOTE_POLICIES.join(\", \")}","messagePattern":"Invalid `remote_policy`: \"(.+?)\"\\. Must be one of: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":".github/scripts/validate-companies.js","lineNumber":123,"sourceCode":"  }\n\n  // Check required fields\n  for (const field of REQUIRED_FIELDS) {\n    if (!data[field] || (typeof data[field] === \"string\" && !data[field].trim())) {\n      errors.push(`Missing required field: \\`${field}\\``);\n    }\n  }\n\n  // Validate enum values (only if field exists)\n  if (data.region && !VALID_REGIONS.includes(data.region)) {\n    errors.push(\n      `Invalid \\`region\\`: \"${data.region}\". Must be one of: ${VALID_REGIONS.join(\", \")}`\n    );\n  }\n\n  if (data.remote_policy && !VALID_REMOTE_POLICIES.includes(data.remote_policy)) {\n    errors.push(\n      `Invalid \\`remote_policy\\`: \"${data.remote_policy}\". Must be one of: ${VALID_REMOTE_POLICIES.join(\", \")}`\n    );\n  }\n\n  if (data.company_size && !VALID_COMPANY_SIZES.includes(data.company_size)) {\n    errors.push(\n      `Invalid \\`company_size\\`: \"${data.company_size}\". Must be one of: ${VALID_COMPANY_SIZES.join(\", \")}`\n    );\n  }\n\n  // Validate technologies array\n  if (data.technologies && Array.isArray(data.technologies)) {\n    for (const tech of data.technologies) {\n      if (!VALID_TECHNOLOGIES.includes(tech)) {\n        errors.push(\n          `Invalid technology tag: \"${tech}\". Valid tags: ${VALID_TECHNOLOGIES.join(\", \")}`\n        );\n      }\n    }","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/remoteintech/remote-jobs/blob/b1dd8deb1945e5ff58f9e9c35e318f53c8871930/.github/scripts/validate-companies.js#L105-L141","documentation":"Enum check at lines 121-125. If data.remote_policy is present but not in VALID_REMOTE_POLICIES (keys of labels().remotePolicy from src/_data/labels.js), the value is rejected. Allowed values include the likes of fully-remote, remote-first, remote-friendly, hybrid.","triggerScenarios":"Contributor writes 'remote', 'fully remote' (space), 'Remote-First' (casing), or 'office-first'; taxonomy was renamed in labels.js without a profile update.","commonSituations":"Informal phrasing instead of the canonical kebab-case key; copy from an outdated template; the company changed policy and the contributor guessed the new key.","solutions":["Use the exact kebab-case key from the error message's allowed list.","If the policy genuinely doesn't fit, add the new key to labels().remotePolicy and verify rendering."],"exampleFix":"// before\nremote_policy: fully remote\n// after\nremote_policy: fully-remote","handlingStrategy":"validation","validationCode":"const VALID_REMOTE_POLICIES = Object.keys(labels().remotePolicy);\nfunction validRemotePolicy(value) {\n  return VALID_REMOTE_POLICIES.includes(value);\n}","typeGuard":"function isRemotePolicy(value) {\n  return typeof value === 'string' && Object.keys(labels().remotePolicy).includes(value);\n}","tryCatchPattern":null,"preventionTips":["Use the kebab-case key from labels.js, not a free-text description.","When the policy taxonomy changes, sweep all profiles in one commit."],"tags":["enum","remote-policy","frontmatter","labels"],"backgroundTag":null,"analyzedSha":"b1dd8deb1945e5ff58f9e9c35e318f53c8871930","analyzedAt":"2026-08-13T04:09:00.804Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}