{"record":{"id":"f48fb4def00f31ba","repo":"abhigyanpatwari/GitNexus","slug":"understand-quickly-expected-id-of-the-form-owne","errorCode":null,"errorMessage":"[understand-quickly] expected id of the form \"owner/repo\", got \"${id}\". The registry uses this string to look up your entry in registry.json — it must match the GitHub owner/repo of the source code, not a local path.","messagePattern":"\\[understand-quickly\\] expected id of the form \"owner/repo\", got \"(.+?)\"\\. The registry uses this string to look up your entry in registry\\.json — it must match the GitHub owner/repo of the source code, not a local path\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"gitnexus-shared/src/integrations/understand-quickly.ts","lineNumber":51,"sourceCode":"export const UNDERSTAND_QUICKLY_TOKEN_ENV = 'UNDERSTAND_QUICKLY_TOKEN';\n\nexport interface UqDispatchPayload {\n  event_type: typeof UNDERSTAND_QUICKLY_EVENT_TYPE;\n  client_payload: {\n    /** `<owner>/<repo>` shape — must match the registered entry. */\n    id: string;\n  };\n}\n\n/**\n * Build the JSON body for the `repository_dispatch` ping. Pure — no\n * env reads, no network. Validates that `id` looks like `owner/repo`\n * (one slash, no whitespace, both halves non-empty) so a misconfigured\n * caller fails loudly before the round-trip.\n */\nexport function buildUqDispatchPayload(id: string): UqDispatchPayload {\n  if (!isValidOwnerRepo(id)) {\n    throw new Error(\n      `[understand-quickly] expected id of the form \"owner/repo\", got \"${id}\". ` +\n        `The registry uses this string to look up your entry in registry.json — ` +\n        `it must match the GitHub owner/repo of the source code, not a local path.`,\n    );\n  }\n  return {\n    event_type: UNDERSTAND_QUICKLY_EVENT_TYPE,\n    client_payload: { id },\n  };\n}\n\n/**\n * `owner/repo` validation. Conservative on purpose: GitHub's actual\n * naming rules are looser, but we want to catch local paths\n * (`/Users/...`), bare slugs (`my-repo`), and accidental whitespace.\n *\n * Matches GitHub's published slug rules:\n *   owner: starts with alnum, then alnum/hyphen only, must end with","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus-shared/src/integrations/understand-quickly.ts#L33-L69","documentation":"Thrown by buildUqDispatchPayload() when the `id` argument does not match the `owner/repo` shape required by the understand-quickly registry. The validator (isValidOwnerRepo) enforces GitHub slug rules: one slash, no whitespace, owner starts/ends alphanumeric (max 39 chars), repo is alnum/dot/hyphen/underscore (max 100 chars). This fails loudly before the network round-trip so a misconfigured caller doesn't get a confusing 422 from GitHub.","triggerScenarios":"Calling buildUqDispatchPayload(id) where id is a local filesystem path (/Users/x/repo), a bare slug (my-repo), contains whitespace, has multiple slashes, uses an underscore/dot in the owner segment, or has a trailing hyphen in the owner. Any of these fail the regex /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\\/[A-Za-z0-9._-]{1,100}$/.","commonSituations":"Passing an absolute local path instead of the GitHub owner/repo; copy-pasting a git remote URL (git@github.com:owner/repo.git) instead of the slug; trailing slash or .git suffix not stripped; a typo introducing a space; an organization name with a trailing hyphen that GitHub itself rejects at creation.","solutions":["Pass the literal 'owner/repo' slug matching the registered entry in registry.json","If deriving from a git remote, use parseOwnerRepoFromRemote() which strips .git and trailing slashes and extracts owner/repo","Validate with isValidOwnerRepo(id) before calling buildUqDispatchPayload to surface the problem at the right layer","Check for stray whitespace, multiple slashes, or a leading/trailing hyphen in the owner half"],"exampleFix":"// before — passing a local path\nbuildUqDispatchPayload('/Users/me/code/my-repo'); // throws\n\n// after — pass the GitHub owner/repo slug\nbuildUqDispatchPayload('my-org/my-repo');\n\n// or derive it from the git remote\nconst id = parseOwnerRepoFromRemote('git@github.com:my-org/my-repo.git');\nif (id) buildUqDispatchPayload(id);","handlingStrategy":"validation","validationCode":"import { isValidOwnerRepo } from 'gitnexus-shared/src/integrations/understand-quickly.js';\n// Validate before constructing the payload\nif (!isValidOwnerRepo(id)) {\n  throw new Error(`Refusing to build dispatch payload: '${id}' is not owner/repo`);\n}\nconst payload = buildUqDispatchPayload(id);","typeGuard":"import { isValidOwnerRepo } from 'gitnexus-shared/src/integrations/understand-quickly.js';\nfunction isOwnerRepo(s: string): s is string { return isValidOwnerRepo(s); } // nominal; the value is already a string","tryCatchPattern":"try {\n  const payload = buildUqDispatchPayload(id);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('[understand-quickly]')) {\n    // surface a clear config error to the user; suggest deriving from git remote\n    const derived = parseOwnerRepoFromRemote(gitRemoteUrl);\n    if (derived) return buildUqDispatchPayload(derived);\n  }\n  throw e;\n}","preventionTips":["Derive the id from the git remote via parseOwnerRepoFromRemote() rather than typing it manually","Strip trailing .git and slashes before validation (parseOwnerRepoFromRemote does this internally)","Validate at the input/config layer so the dispatch layer receives clean data","Match the id exactly to the registry.json entry — owner/repo is case-sensitive"],"tags":["validation","understand-quickly","registry","github"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}