{"record":{"id":"b71cdbf3ce07eff0","repo":"garrytan/gstack","slug":"tasks-section-emit-requires-one-of-valid-pha","errorCode":null,"errorMessage":"TASKS_SECTION_EMIT requires one of ${[...VALID_PHASES].join(', ')} — got ${phase}","messagePattern":"TASKS_SECTION_EMIT requires one of (.+?) — got (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/resolvers/tasks-section.ts","lineNumber":17,"sourceCode":"/**\n * Resolvers for the Implementation Tasks emission (#1454).\n *\n *   {{TASKS_SECTION_EMIT:<phase>}}     — per-skill task emission + JSONL write\n *   {{TASKS_SECTION_AGGREGATE}}        — autoplan aggregation across all phases\n *\n * Schema for the JSONL artifact lives in scripts/task-emission-schema.ts.\n */\n\nimport type { TemplateContext, ResolverFn } from './types';\n\nconst VALID_PHASES = new Set(['ceo-review', 'design-review', 'eng-review', 'devex-review']);\n\nexport const generateTasksSectionEmit: ResolverFn = (_ctx: TemplateContext, args?: string[]) => {\n  const phase = args?.[0];\n  if (!phase || !VALID_PHASES.has(phase)) {\n    throw new Error(`TASKS_SECTION_EMIT requires one of ${[...VALID_PHASES].join(', ')} — got ${phase}`);\n  }\n\n  return `## Implementation Tasks\n\nBefore closing this review, synthesize the findings above into a flat list of\nbuild-actionable tasks. Each task derives from a specific finding — no padding.\nEmit the markdown section AND write a JSONL artifact that \\`/autoplan\\` can\naggregate across phases.\n\n### Markdown section (always emit)\n\n\\`\\`\\`markdown\n## Implementation Tasks\nSynthesized from this review's findings. Each task derives from a specific\nfinding above. Run with Claude Code or Codex; checkbox as you ship.\n\n- [ ] **T1 (P1, human: ~2h / CC: ~15min)** — <component> — <imperative title>\n  - Surfaced by: <section name> — <specific finding text or line reference>","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/scripts/resolvers/tasks-section.ts#L1-L35","documentation":"generateTasksSectionEmit() in scripts/resolvers/tasks-section.ts:17 requires the phase argument to be one of VALID_PHASES: 'ceo-review', 'design-review', 'eng-review', 'devex-review'. Any other value (or missing value) throws. The phase names are kebab-case.","triggerScenarios":"Passing a phase outside the set. Typo like `ceo_review` (underscore) or `ceoReview` (camelCase). Adding a new review phase without updating VALID_PHASES.","commonSituations":"Extending the autoplan review sequence with a new phase. Copying from documentation using a different naming convention.","solutions":["Use exactly one of the four phase strings in kebab-case","If you intentionally added a new phase, extend the VALID_PHASES set first"],"exampleFix":"<!-- before -->\n{{TASKS_SECTION_EMIT:ceo_review}}\n<!-- after -->\n{{TASKS_SECTION_EMIT:ceo-review}}","handlingStrategy":"type-guard","validationCode":"const VALID_PHASES = new Set(['ceo-review', 'design-review', 'eng-review', 'devex-review']);\nif (phase && !VALID_PHASES.has(phase)) {\n  throw new Error(`phase must be one of: ${[...VALID_PHASES].join(', ')}`);\n}","typeGuard":"const VALID_PHASES = new Set(['ceo-review', 'design-review', 'eng-review', 'devex-review']);\nconst isTaskPhase = (p: string): boolean => VALID_PHASES.has(p);","tryCatchPattern":null,"preventionTips":["Reference the VALID_PHASES constant when extending rather than string literals","Keep phase names kebab-case to match the existing convention","Update VALID_PHASES before referencing a new phase in any .tmpl"],"tags":["template","resolver","tasks","autoplan"],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}