{"record":{"id":"f17225a29d0714a7","repo":"affaan-m/ECC","slug":"issue-issuenumber-is-not-ready-to-publish-v","errorCode":null,"errorMessage":"Issue #${issueNumber} is not ready to publish: ${validation.validations.map(entry => `${entry.check}=${entry.ok}`).join(', ')}","messagePattern":"Issue #(.+?) is not ready to publish: (.+?)=(.+?)`\\)\\.join\\(', '\\)\\}","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/github-coordination/actions.js","lineNumber":185,"sourceCode":"\n  return {\n    ...summarizeStateForOutput(repo, trackedIssue, nextState, 'validate', policy),\n    ok,\n    validations,\n    missingDependencies,\n  };\n}\n\nfunction applyPublish(repo, issueNumber, options = {}, context = {}) {\n  assertValidRepo(repo);\n  assertValidIssueNumber(issueNumber);\n  const policy = context.policy || loadPolicy(context.rootDir || process.cwd(), options.configPath);\n  const issue = getIssue(repo, issueNumber, options);\n  const state = getCoordinationState(issue, policy);\n  const validation = applyValidate(repo, issueNumber, { ...options, dryRun: true }, context, issue);\n\n  if (!validation.ok) {\n    throw new Error(`Issue #${issueNumber} is not ready to publish: ${validation.validations.map(entry => `${entry.check}=${entry.ok}`).join(', ')}`);\n  }\n\n  if (policy.review && policy.review.required && state.review !== 'approved') {\n    throw new Error(`Issue #${issueNumber} cannot be published: review approval required (current: ${state.review})`);\n  }\n\n  const nextState = buildIssueStateFromAction(issue, state, 'publish', {\n    status: 'published',\n    validation: 'passed',\n    review: state.review === 'changes-requested' ? state.review : 'approved',\n    projectState: 'done',\n  }, policy);\n  const trackedIssue = {\n    ...issue,\n    labels: desiredLabelsForState(nextState, policy),\n  };\n\n  if (!options.dryRun) {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/github-coordination/actions.js#L167-L203","documentation":"Thrown by applyPublish when applyValidate (run in dry-run) returns ok:false. Publishing an issue requires every validation check to pass; the message enumerates each check and its ok flag so the caller sees exactly which gates failed (e.g. dependencies-closed=false, validation=false). This runs before any label/state mutation so a half-published issue is avoided.","triggerScenarios":"Dependencies (referenced issues) not all closed; the issue body is missing required sections; the coordination state JSON is malformed; validation checks fail for any reason encoded in applyValidate.","commonSituations":"Trying to publish an epic whose sub-issues are still open; body coordination block was hand-edited and broke; a validation rule was added/tightened in policy since last publish attempt.","solutions":["Read the check=list in the message and fix each check=false item: close dependencies, repair the body, satisfy validation rules.","Run applyValidate directly (dryRun:true) to get the full validation.validations array with per-check messages before retrying publish.","If a check is intentionally skippable, review the policy config for that check's required flag.","Re-run applyPublish only after all checks report ok:true."],"exampleFix":"// before\napplyPublish(repo, issueNumber);\n\n// after — pre-validate and show per-check detail\nconst v = applyValidate(repo, issueNumber, { dryRun: true }, context);\nif (!v.ok) {\n  for (const entry of v.validations) {\n    if (!entry.ok) console.error(`FAIL ${entry.check}: ${entry.message || ''}`);\n  }\n  process.exit(1);\n}\napplyPublish(repo, issueNumber);","handlingStrategy":"validation","validationCode":"const v = applyValidate(repo, issueNumber, { dryRun: true }, context);\nif (!v.ok) {\n  const failed = v.validations.filter(x => !x.ok).map(x => `${x.check}=${x.message||''}`);\n  throw new Error(`Publish blocked: ${failed.join('; ')}`);\n}","typeGuard":"function allChecksPass(validation) {\n  return Boolean(validation && validation.ok === true && Array.isArray(validation.validations) && validation.validations.every(x => x.ok));\n}","tryCatchPattern":"try {\n  applyPublish(repo, issueNumber);\n} catch (e) {\n  if (/not ready to publish/.test(e.message)) { console.error(e.message); process.exit(1); }\n  throw e;\n}","preventionTips":["Run applyValidate in dry-run before publish and fix each failing check.","Keep dependencies closed and the coordination block well-formed before attempting publish.","Treat the check=list as an actionable checklist."],"tags":["github-coordination","publish","validation","policy"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}