{"record":{"id":"4cc9b22aab7d28bf","repo":"affaan-m/ECC","slug":"missing-repo-owner-repo","errorCode":null,"errorMessage":"Missing --repo <owner/repo>.","messagePattern":"Missing --repo <owner/repo>\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/github-coordination.js","lineNumber":170,"sourceCode":"  throw new Error(`Unknown command: ${options.command}`);\n}\n\nfunction formatOutput(payload, options) {\n  if (options.json) {\n    process.stdout.write(`${JSON.stringify(payload, null, 2)}\\n`);\n  } else if (options.command === 'sync' || options.command === 'unblock') {\n    process.stdout.write(formatCollection(payload));\n  } else {\n    process.stdout.write(formatSummary(payload));\n  }\n}\n\nasync function main() {\n  let store = null;\n  try {\n    const options = parseArgs(process.argv);\n    if (options.help) usage(0);\n    if (!options.repo) throw new Error('Missing --repo <owner/repo>.');\n\n    const policy = loadPolicy(process.cwd(), options.configPath);\n    store = await openStore({\n      dbPath: options.dbPath,\n      homeDir: options.homeDir || process.env.HOME || os.homedir(),\n    });\n\n    const payload = dispatchCommand(options, { store, policy, rootDir: process.cwd() });\n    formatOutput(payload, options);\n  } catch (error) {\n    console.error(`Error: ${error.message}`);\n    process.exit(1);\n  } finally {\n    if (store) store.close();\n  }\n}\n\nif (require.main === module) {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/github-coordination.js#L152-L188","documentation":"main() in scripts/github-coordination.js validates after parseArgs that options.repo was supplied; if not, it throws 'Missing --repo <owner/repo>.' before loading policy or opening the store. Every coordination operation needs a target GitHub repository in owner/repo form.","triggerScenarios":"Running the CLI without the --repo flag at all; --repo given with an empty value; a config/env-based wrapper that assumes a default repo which this script does not read.","commonSituations":"First-time users omitting the required flag; CI matrices where the repo variable is empty on forked PRs; aliasing the flag as --repository which parseArgs ignores; forgetting the flag when a subcommand-level flag list was documented instead.","solutions":["Add --repo <owner/repo> to the invocation, e.g. --repo my-org/my-repo.","Check the flag spelling against parseArgs — no other variant sets options.repo.","In CI, ensure the repository env var is populated: `--repo \"${GITHUB_REPOSITORY:?}\"`.","Wrap dispatch in a helper that injects a default repo for your team."],"exampleFix":"// before\nnode scripts/github-coordination.js claim --issue-number 42\n\n// after\nnode scripts/github-coordination.js claim --repo my-org/my-repo --issue-number 42","handlingStrategy":"validation","validationCode":"if (!options.repo || !/^[^/]+\\/[^/]+$/.test(options.repo)) {\n  throw new Error('Missing --repo <owner/repo>.');\n}","typeGuard":"const hasRepo = (o) => typeof o.repo === 'string' && /^[\\w.-]+\\/[\\w.-]+$/.test(o.repo);","tryCatchPattern":"try {\n  await main();\n} catch (e) {\n  if (e.message.includes('Missing --repo')) {\n    console.error('Pass --repo <owner/repo>, e.g. --repo my-org/my-repo');\n    process.exit(2);\n  }\n  throw e;\n}","preventionTips":["Default to GITHUB_REPOSITORY in CI: --repo \"${GITHUB_REPOSITORY:?}\".","Keep one wrapper script that injects the repo so call sites cannot forget it.","Validate owner/repo shape (one slash, no spaces) before invoking.","List required flags at the top of any runbook using this script."],"tags":["cli","validation","missing-argument"],"backgroundTag":"missing-required-flag","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}