{"record":{"id":"bc5eeac2fb4c330b","repo":"jackwener/OpenCLI","slug":"openreview-label-value-is-not-a-valid-foru","errorCode":null,"errorMessage":"openreview ${label} \"${value}\" is not a valid forum id (expected 6-20 chars of [A-Za-z0-9_-])","messagePattern":"openreview (.+?) \"(.+?)\" is not a valid forum id \\(expected 6-20 chars of \\[A-Za-z0-9_-\\]\\)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/openreview/utils.js","lineNumber":53,"sourceCode":"    return n;\n}\n\nexport function requireNonNegativeInt(value, defaultValue, label = 'offset') {\n    const raw = value ?? defaultValue;\n    const n = coerceInt(raw);\n    if (!Number.isInteger(n) || n < 0) {\n        throw new ArgumentError(`openreview ${label} must be a non-negative integer`);\n    }\n    return n;\n}\n\nexport function requireForumId(value, label = 'id') {\n    const id = String(value ?? '').trim();\n    if (!id) {\n        throw new ArgumentError(`openreview ${label} is required`);\n    }\n    if (!ID_PATTERN.test(id)) {\n        throw new ArgumentError(`openreview ${label} \"${value}\" is not a valid forum id (expected 6-20 chars of [A-Za-z0-9_-])`);\n    }\n    return id;\n}\n\n/** OpenReview profile ids are `~...N` slugs and may include dots, hyphens, and Unicode letters. */\nconst PROFILE_ID_PATTERN = /^~(?=.*\\p{L})[\\p{L}\\p{M}0-9._-]+\\d+$/u;\n\nexport function requireProfileId(value, label = 'profile') {\n    const id = String(value ?? '').trim();\n    if (!id) {\n        throw new ArgumentError(`openreview ${label} is required`);\n    }\n    if (!PROFILE_ID_PATTERN.test(id)) {\n        throw new ArgumentError(`openreview ${label} \"${value}\" is not a valid profile id (expected \"~First_Last1\" or similar; find it on the author's openreview.net profile URL)`);\n    }\n    return id;\n}\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/openreview/utils.js#L35-L71","documentation":"requireForumId throws ArgumentError when the value is present but does not match ID_PATTERN (6-20 chars of [A-Za-z0-9_-]). This catches typos, pasted URLs, or ids with slashes before a request is made. Only forum ids, not profile ids (~Name1), pass this pattern.","triggerScenarios":"Passing a full openreview.net URL, a forum id containing '/' or '~', an id shorter than 6 or longer than 20 chars, or an id with spaces/punctuation to id(args) or forum(args).","commonSituations":"Pasting the whole forum URL instead of the id segment; copying an invitation id like 'ICLR.cc/2025/Conference/-/Submission' where a forum id is expected; extra whitespace inside the value; truncating a long id.","solutions":["Extract just the id from the URL: the last path segment of openreview.net/forum?id=<ID>.","Verify the id is 6-20 chars limited to letters, digits, underscore, hyphen.","For venue/invitation lookups, use the venue command (which accepts invitation ids) instead of forum."],"exampleFix":"// before\ncli forum 'https://openreview.net/forum?id=HkxJq3ZtDr'\n// after\ncli forum 'HkxJq3ZtDr'","handlingStrategy":"validation","validationCode":"const ID_RE = /^[A-Za-z0-9_-]{6,20}$/;\nif (!ID_RE.test(args.id)) { console.error(`invalid forum id: ${args.id}`); process.exit(2); }","typeGuard":"const isValidForumId = (v) => typeof v === 'string' && /^[A-Za-z0-9_-]{6,20}$/.test(v.trim());","tryCatchPattern":"try { const id = requireForumId(args.id); } catch (e) { if (e instanceof ArgumentError) { console.error(e.message); process.exit(2); } throw e; }","preventionTips":["Never paste the full URL; take the ?id= value only.","Remember forum ids are 6-20 chars of [A-Za-z0-9_-].","Validate ids in CI/scripts before invoking the command."],"tags":["validation","argument-error","format-validation"],"backgroundTag":"invalid-identifier-format","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}