{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/github-coordination/actions.js","lineNumber":202,"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":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/github-coordination/actions.js#L184-L220","documentation":"applyPublish refuses to publish an issue whose pre-flight validation (a dry-run applyValidate) reports any failing check. The error message enumerates every validation entry as check=true/false so the developer can see exactly which gates failed, e.g. acceptance-criteria=false, tasks-linked=false. This is a policy gate protecting the coordination workflow from publishing incomplete or inconsistent issues.","triggerScenarios":"Calling applyPublish on an issue that fails any applyValidate check: missing acceptance criteria, no linked tasks, wrong labels, bad state, stale coordination labels, etc. The failing checks are listed comma-separated in the message.","commonSituations":"Trying to publish a freshly decomposed issue before tasks were created and linked; editing an issue so it no longer matches the policy template; running publish in CI before earlier workflow steps completed; policy made stricter (new checks) after the issue was authored.","solutions":["Run applyValidate (or applyPublish with dryRun) and fix each listed failing check on the issue","Add the missing acceptance criteria, tasks, labels, or metadata the policy requires","Re-run applyDecompose/applySync to bring the issue back in line with the policy","Adjust policy config only if the check is genuinely not applicable to this issue"],"exampleFix":"// before\napplyPublish(repo, 42, {}) // fails: acceptance-criteria=false\n// after: fix the issue body, then verify\nconst v = applyValidate(repo, 42, { dryRun: true }, ctx);\nif (!v.ok) fixIssuePerValidations(v.validations);\napplyPublish(repo, 42, {})","handlingStrategy":"try-catch","validationCode":"const validation = applyValidate(repo, issueNumber, { dryRun: true }, ctx);\nif (!validation.ok) { console.error(validation.validations.filter(v => !v.ok).map(v => v.check)); return; }\napplyPublish(repo, issueNumber, opts);","typeGuard":null,"tryCatchPattern":"try { applyPublish(repo, n, opts); } catch (e) { if (String(e.message).includes('not ready to publish')) { const failed = e.message.split(': ')[1]; console.error(`fix failing checks: ${failed}`); } throw e; }","preventionTips":["Always dry-run applyValidate before publish in scripts and CI","Keep issue bodies conforming to the policy template (criteria, tasks, labels)","Re-run decompose/sync after editing issues so state stays valid","Gate publish steps in CI on validation passing"],"tags":["github","publish","validation-policy"],"backgroundTag":"invalid-state-transition","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"}